Skip to content
Snippets Groups Projects
app.py 2.22 KiB
Newer Older
DIANE's avatar
DIANE committed
from Packages import *
st.set_page_config(page_title="NIRS Utils", page_icon=":goat:", layout="wide",)
if 'interface' not in st.session_state:
    st.session_state['interface'] = 'simple'
DIANE's avatar
DIANE committed
from Modules import *
DIANE's avatar
DIANE committed

Nicolas BARTHES's avatar
Nicolas BARTHES committed

# # TOC menu on the left
show_pages(
    [Page("app.py", "Home"),
     Page("pages\\1-samples_selection.py", "Samples Selection"),
     Page("pages\\2-model_creation.py", "Models Creation"),
     Page("pages\\3-prediction.py", "Predictions"),
     ]
)
hide_pages("Samples Selection")
hide_pages("Models Creation")
hide_pages("Predictions")
DIANE's avatar
DIANE committed

with st.sidebar:
    interface = st.selectbox(label="Interface", options=['simple', 'advanced'], key='interface')
    st.page_link('pages\\1-samples_selection.py')
    if st.session_state['interface'] == 'simple':
        st.page_link('pages\\2-model_creation.py')
    # if advanced interface, split Models Creation and Predictions
    elif st.session_state['interface'] == 'advanced':
        show_pages(
            [Page("app.py", "Home"),
             Page("pages\\1-samples_selection.py", "Samples Selection"),
             Page("pages\\2-model_creation.py", "Models Creation"),
             Page("pages\\3-prediction.py", "Predictions"),
             ]
        )
        st.page_link('pages\\2-model_creation.py')
        st.page_link('pages\\3-prediction.py')
DIANE's avatar
DIANE committed

Nicolas BARTHES's avatar
Nicolas BARTHES committed
with st.container():
DIANE's avatar
DIANE committed
    st.subheader("Plateforme d'Analyses Chimiques pour l'Ecologie-PACE :goat:")
Nicolas BARTHES's avatar
Nicolas BARTHES committed
    st.title("NIRS Utils")
    st.write("Samples selection (PCA, [UMAP](https://umap-learn.readthedocs.io/en/latest/how_umap_works.html), ...), Predictive Modelling ([Pinard](https://github.com/GBeurier/pinard), [LWPLSR](https://doi.org/10.1002/cem.3209), ...), and Predictions using your data (CSV or DX files) and/or PACE NIRS Database.")
DIANE's avatar
DIANE committed
    #st.image(img_general)
    st.markdown("### We could add documentation here ###")
    header1, header2, header3 = st.columns(3)
    if header1.button("Samples Selection"):
        st.switch_page('pages\\1-samples_selection.py')
    if header2.button("Model Creation"):
        st.switch_page('pages\\2-model_creation.py')
    if header3.button("Predictions"):
        st.switch_page('pages\\3-prediction.py')