sobinalosious92 commited on
Commit
0885ace
·
verified ·
1 Parent(s): 6892286

Upload Home.py

Browse files
Files changed (1) hide show
  1. Home.py +158 -0
Home.py ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import base64
2
+ from pathlib import Path
3
+
4
+ import streamlit as st
5
+
6
+ from src.ui_style import apply_global_style
7
+
8
+ st.set_page_config(page_title="Home", layout="wide")
9
+ apply_global_style()
10
+
11
+ logo_path = Path(__file__).resolve().parent / "icons" / "logo.png"
12
+ logo_data_uri = ""
13
+ if logo_path.exists():
14
+ logo_data_uri = "data:image/png;base64," + base64.b64encode(logo_path.read_bytes()).decode("ascii")
15
+
16
+ st.markdown(
17
+ """
18
+ <div style="margin: 0.15rem 0 0.4rem 0;">
19
+ <span class="pp-badge">Home</span>
20
+ </div>
21
+ """,
22
+ unsafe_allow_html=True,
23
+ )
24
+
25
+ st.markdown(
26
+ f"""
27
+ <section class="pp-main-card">
28
+ <div class="pp-main-grid">
29
+ <div>
30
+ <h1 class="pp-main-title">Polymer Discovery Platform</h1>
31
+ <p class="pp-main-copy">
32
+ A unified platform for polymer research that combines property prediction, molecular visualization, and objective-driven candidate discovery to support faster, data-backed screening and selection decisions.
33
+ </p>
34
+ </div>
35
+ <div class="pp-main-logo">
36
+ {"<img src='" + logo_data_uri + "' alt='Platform logo' />" if logo_data_uri else ""}
37
+ </div>
38
+ </div>
39
+ </section>
40
+ """,
41
+ unsafe_allow_html=True,
42
+ )
43
+
44
+ stats = [
45
+ ("25+", "Properties"),
46
+ ("13K+", "Real Polymers"),
47
+ ("1M", "Virtual Polymers"),
48
+ ]
49
+ stats_html = "".join(
50
+ [
51
+ f"""
52
+ <div class="pp-kpi-item">
53
+ <p class="pp-kpi-value">{value}</p>
54
+ <p class="pp-kpi-label">{label}</p>
55
+ </div>
56
+ """
57
+ for value, label in stats
58
+ ]
59
+ )
60
+ st.markdown(f'<section class="pp-kpi-strip">{stats_html}</section>', unsafe_allow_html=True)
61
+
62
+ st.divider()
63
+ st.markdown("### Platform Modules")
64
+ st.caption(
65
+ "Use the modules below to probe, predict, visualize, discover, and ground polymer decisions with literature evidence."
66
+ )
67
+
68
+ cards = [
69
+ (
70
+ "Property Probe",
71
+ "Input a single SMILES or polymer name and retrieve predicted or available values for one target property. "
72
+ "Best for quick validation before larger screening.",
73
+ "pages/1_Property_Probe.py",
74
+ ),
75
+ (
76
+ "Batch Prediction",
77
+ "Upload or paste many SMILES and run bulk property prediction in one job. "
78
+ "Useful when you want ranked outputs and exportable tables for downstream analysis.",
79
+ "pages/2_Batch_Prediction.py",
80
+ ),
81
+ (
82
+ "Molecular View",
83
+ "Render 2D and 3D molecular structures, inspect composition, and download visual assets "
84
+ "or MOL files for documentation and simulation setup.",
85
+ "pages/3_Molecular_View.py",
86
+ ),
87
+ (
88
+ "Discovery (Manual)",
89
+ "Set hard constraints, objectives, trust/selection weights, and diversity settings directly. "
90
+ "Designed for controlled multi-objective exploration with transparent parameter tuning.",
91
+ "pages/4_Discovery_(Manual).py",
92
+ ),
93
+ (
94
+ "Discovery (AI)",
95
+ "Describe target behavior in natural language and let the LLM build discovery settings. "
96
+ "You can run directly or inspect/edit the generated JSON in advanced mode.",
97
+ "pages/5_Discovery_(AI).py",
98
+ ),
99
+ (
100
+ "Novel SMILES Generation",
101
+ "Sample new polymer SMILES with the pretrained RNN and filter out molecules already present "
102
+ "in local datasets (EXP/MD/DFT/GC/POLYINFO/PI1M).",
103
+ "pages/6_Novel_SMILES_Generation.py",
104
+ ),
105
+ (
106
+ "Literature Search",
107
+ "Search polymer papers, stage evidence records, inspect OA/PDF availability, and review structured material-property evidence before promotion.",
108
+ "pages/7_Literature_Search.py",
109
+ ),
110
+ (
111
+ "Feedback",
112
+ "Send bug reports, feature requests, and usage feedback.",
113
+ "pages/8_Feedback.py",
114
+ ),
115
+ ]
116
+
117
+ for i, (title, desc, page_path) in enumerate(cards, start=1):
118
+ c1, c2 = st.columns([5, 1.1], vertical_alignment="center")
119
+ page_exists = (Path(__file__).resolve().parent / page_path).exists()
120
+ with c1:
121
+ st.markdown(
122
+ f"""
123
+ <div class="pp-module-card">
124
+ <p class="pp-module-title">{title}</p>
125
+ <p class="pp-module-copy">{desc}</p>
126
+ </div>
127
+ """,
128
+ unsafe_allow_html=True,
129
+ )
130
+ with c2:
131
+ if st.button("Open", type="primary", key=f"home_go_{i}", disabled=not page_exists):
132
+ st.switch_page(page_path)
133
+
134
+ st.divider()
135
+ st.markdown(
136
+ """
137
+ <section class="pp-lab-card">
138
+ <div class="pp-lab-head">
139
+ <span class="pp-lab-kicker">Research Partner</span>
140
+ <h3 class="pp-lab-title">Developed by MONSTER Lab</h3>
141
+ <p class="pp-lab-subtitle">
142
+ Molecular/Nano-Scale Transport &amp; Energy Research Laboratory | College of Engineering, University of Notre Dame
143
+ </p>
144
+ </div>
145
+ <p class="pp-lab-copy">
146
+ The MONSTER Lab studies the
147
+ physics of energy and mass transport across molecular and nano-scales using theory, simulation,
148
+ data-driven methods, and experiments. The team translates these insights into materials and
149
+ systems for thermal management, energy efficiency, water desalination, high-sensitivity biosensing,
150
+ and additive manufacturing.
151
+ </p>
152
+ <a class="pp-lab-link" href="https://monsterlab.nd.edu/" target="_blank" rel="noopener noreferrer">
153
+ Visit MONSTER Lab Website
154
+ </a>
155
+ </section>
156
+ """,
157
+ unsafe_allow_html=True,
158
+ )