POLYMER-PROPERTY / Home.py
sobinalosious92's picture
Upload Home.py
0885ace verified
import base64
from pathlib import Path
import streamlit as st
from src.ui_style import apply_global_style
st.set_page_config(page_title="Home", layout="wide")
apply_global_style()
logo_path = Path(__file__).resolve().parent / "icons" / "logo.png"
logo_data_uri = ""
if logo_path.exists():
logo_data_uri = "data:image/png;base64," + base64.b64encode(logo_path.read_bytes()).decode("ascii")
st.markdown(
"""
<div style="margin: 0.15rem 0 0.4rem 0;">
<span class="pp-badge">Home</span>
</div>
""",
unsafe_allow_html=True,
)
st.markdown(
f"""
<section class="pp-main-card">
<div class="pp-main-grid">
<div>
<h1 class="pp-main-title">Polymer Discovery Platform</h1>
<p class="pp-main-copy">
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.
</p>
</div>
<div class="pp-main-logo">
{"<img src='" + logo_data_uri + "' alt='Platform logo' />" if logo_data_uri else ""}
</div>
</div>
</section>
""",
unsafe_allow_html=True,
)
stats = [
("25+", "Properties"),
("13K+", "Real Polymers"),
("1M", "Virtual Polymers"),
]
stats_html = "".join(
[
f"""
<div class="pp-kpi-item">
<p class="pp-kpi-value">{value}</p>
<p class="pp-kpi-label">{label}</p>
</div>
"""
for value, label in stats
]
)
st.markdown(f'<section class="pp-kpi-strip">{stats_html}</section>', unsafe_allow_html=True)
st.divider()
st.markdown("### Platform Modules")
st.caption(
"Use the modules below to probe, predict, visualize, discover, and ground polymer decisions with literature evidence."
)
cards = [
(
"Property Probe",
"Input a single SMILES or polymer name and retrieve predicted or available values for one target property. "
"Best for quick validation before larger screening.",
"pages/1_Property_Probe.py",
),
(
"Batch Prediction",
"Upload or paste many SMILES and run bulk property prediction in one job. "
"Useful when you want ranked outputs and exportable tables for downstream analysis.",
"pages/2_Batch_Prediction.py",
),
(
"Molecular View",
"Render 2D and 3D molecular structures, inspect composition, and download visual assets "
"or MOL files for documentation and simulation setup.",
"pages/3_Molecular_View.py",
),
(
"Discovery (Manual)",
"Set hard constraints, objectives, trust/selection weights, and diversity settings directly. "
"Designed for controlled multi-objective exploration with transparent parameter tuning.",
"pages/4_Discovery_(Manual).py",
),
(
"Discovery (AI)",
"Describe target behavior in natural language and let the LLM build discovery settings. "
"You can run directly or inspect/edit the generated JSON in advanced mode.",
"pages/5_Discovery_(AI).py",
),
(
"Novel SMILES Generation",
"Sample new polymer SMILES with the pretrained RNN and filter out molecules already present "
"in local datasets (EXP/MD/DFT/GC/POLYINFO/PI1M).",
"pages/6_Novel_SMILES_Generation.py",
),
(
"Literature Search",
"Search polymer papers, stage evidence records, inspect OA/PDF availability, and review structured material-property evidence before promotion.",
"pages/7_Literature_Search.py",
),
(
"Feedback",
"Send bug reports, feature requests, and usage feedback.",
"pages/8_Feedback.py",
),
]
for i, (title, desc, page_path) in enumerate(cards, start=1):
c1, c2 = st.columns([5, 1.1], vertical_alignment="center")
page_exists = (Path(__file__).resolve().parent / page_path).exists()
with c1:
st.markdown(
f"""
<div class="pp-module-card">
<p class="pp-module-title">{title}</p>
<p class="pp-module-copy">{desc}</p>
</div>
""",
unsafe_allow_html=True,
)
with c2:
if st.button("Open", type="primary", key=f"home_go_{i}", disabled=not page_exists):
st.switch_page(page_path)
st.divider()
st.markdown(
"""
<section class="pp-lab-card">
<div class="pp-lab-head">
<span class="pp-lab-kicker">Research Partner</span>
<h3 class="pp-lab-title">Developed by MONSTER Lab</h3>
<p class="pp-lab-subtitle">
Molecular/Nano-Scale Transport &amp; Energy Research Laboratory | College of Engineering, University of Notre Dame
</p>
</div>
<p class="pp-lab-copy">
The MONSTER Lab studies the
physics of energy and mass transport across molecular and nano-scales using theory, simulation,
data-driven methods, and experiments. The team translates these insights into materials and
systems for thermal management, energy efficiency, water desalination, high-sensitivity biosensing,
and additive manufacturing.
</p>
<a class="pp-lab-link" href="https://monsterlab.nd.edu/" target="_blank" rel="noopener noreferrer">
Visit MONSTER Lab Website
</a>
</section>
""",
unsafe_allow_html=True,
)