Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NIRS_Workflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CEFE
PACE
NIRS_Workflow
Commits
d808fb99
Commit
d808fb99
authored
4 months ago
by
DIANE
Browse files
Options
Downloads
Patches
Plain Diff
input page upgrade
parent
497881c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pages/0-inputs.py
+19
-18
19 additions, 18 deletions
src/pages/0-inputs.py
with
19 additions
and
18 deletions
src/pages/0-inputs.py
+
19
−
18
View file @
d808fb99
...
@@ -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
=
[
"
G
re
en
leaves
"
,
"
Leaf litter
"
,
"
Litter
"
,
"
Humus
"
,
"
Soil
"
,
"
Animal part
"
,
"
Animal Powder
"
,
"
Fungal sample
"
,
"
Other
"
]
meta_sample_sub_category_options
=
[
"
F
re
sh
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
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment