Skip to content
Snippets Groups Projects
Commit d808fb99 authored by DIANE's avatar DIANE
Browse files

input page upgrade

parent 497881c3
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ if 'form_submitted' not in st.session_state: ...@@ -17,7 +17,7 @@ if 'form_submitted' not in st.session_state:
with st.container(): with st.container():
# Text input fields # Text input fields
st.subheader("Complete and save the following form with the data context:",divider="blue") st.subheader("Complete and save the following form with the data context",divider="blue")
st.warning('Make sure that the form is reliably completed, because the quality of the results depends mainly on it !', icon="⚠️") st.warning('Make sure that the form is reliably completed, because the quality of the results depends mainly on it !', icon="⚠️")
with st.form(key = 'my_form'): with st.form(key = 'my_form'):
...@@ -43,7 +43,7 @@ with st.container(): ...@@ -43,7 +43,7 @@ with st.container():
st.subheader("The Nature of the Samples",divider="blue") st.subheader("The Nature of the Samples",divider="blue")
meta_sample_category_options = ["Soil", "Plant", "Animal", "Other"] meta_sample_category_options = ["Soil", "Plant", "Animal", "Other"]
meta_sample_category = st.radio("Samples category :", [""] + meta_sample_category_options) meta_sample_category = st.radio("Samples category :", [""] + meta_sample_category_options)
meta_sample_sub_category_options = ["Green leaves", "Leaf litter", "Litter", "Humus", "Soil", "Animal part", "Animal Powder", "Fungal sample", "Other"] meta_sample_sub_category_options = ["Fresh leaves", "Leaf litter", "Litter", "Humus", "Soil", "Animal part", "Animal Powder", "Fungal sample", "Other"]
meta_sample_sub_category = st.radio("Sample category description :", [""] + meta_sample_sub_category_options) meta_sample_sub_category = st.radio("Sample category description :", [""] + meta_sample_sub_category_options)
with col4: with col4:
...@@ -76,23 +76,24 @@ with st.container(): ...@@ -76,23 +76,24 @@ with st.container():
with open('form_data.json', 'w') as json_file: with open('form_data.json', 'w') as json_file:
json.dump(form_data, json_file) json.dump(form_data, json_file)
match st.session_state['interface']:
case 'simple':
header3, header4 = st.columns(2)
if header3.button("Samples Selection"):
st.switch_page(pages_folder / '1-samples_selection.py')
if header4.button("Model Creation"):
st.switch_page(pages_folder / '2-model_creation.py')
case 'advanced':
header3, header4, header5 = st.columns(3)
if header3.button("Samples Selection"):
st.switch_page(pages_folder / '1-samples_selection.py')
if header4.button("Model Creation"):
st.switch_page(pages_folder / '2-model_creation.py')
if header5.button("Prediction"):
st.switch_page(pages_folder / '3-prediction.py')
else: else:
st.error('Error: The form was not saved, please ensure the required fields are filled!') st.error('Error: The form was not saved, please ensure the required fields are filled!')
if '' not in form_data.values():
match st.session_state['interface']:
case 'simple':
_, header3, header4 = st.columns([.2, .5, .5])
if header4.button("Models Creation & Predictions"):
st.switch_page(pages_folder / '2-model_creation.py')
case 'advanced':
_, header3, header4, header5 = st.columns([.2, .5, .5, .5])
if header4.button("Model Creation"):
st.switch_page(pages_folder / '2-model_creation.py')
if header5.button("Prediction"):
st.switch_page(pages_folder / '3-prediction.py')
if header3.button("Samples Selection"):
st.switch_page(pages_folder / '1-samples_selection.py')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment