Update app.py
Browse files
app.py
CHANGED
@@ -102,9 +102,9 @@ def predict_astigmatism(age, axis, aca):
|
|
102 |
# # unsafe_allow_html=True
|
103 |
# # )
|
104 |
|
105 |
-
# age = st.number_input('Enter Patient Age
|
106 |
-
# aca_magnitude = st.number_input('Enter ACA Magnitude
|
107 |
-
# aca_axis = st.number_input('Enter ACA Axis
|
108 |
|
109 |
# if st.button('Predict!'):
|
110 |
# astigmatism = predict_astigmatism(age, aca_axis, aca_magnitude)
|
@@ -178,21 +178,21 @@ def main():
|
|
178 |
st.session_state.aca_axis = None
|
179 |
|
180 |
# Age input
|
181 |
-
age = st.number_input('Enter Patient Age:', min_value=18.0, max_value=90.0, step=0.1, value=st.session_state.age)
|
182 |
if age != st.session_state.age:
|
183 |
st.session_state.age = age
|
184 |
if age is not None and (age < 18 or age > 90):
|
185 |
st.markdown('<p class="error">Error: Age must be between 18 and 90.</p>', unsafe_allow_html=True)
|
186 |
|
187 |
# ACA Magnitude input
|
188 |
-
aca_magnitude = st.number_input('Enter ACA Magnitude:', min_value=0.0, max_value=10.0, step=0.1, value=st.session_state.aca_magnitude)
|
189 |
if aca_magnitude != st.session_state.aca_magnitude:
|
190 |
st.session_state.aca_magnitude = aca_magnitude
|
191 |
if aca_magnitude is not None and (aca_magnitude < 0 or aca_magnitude > 10):
|
192 |
st.markdown('<p class="error">Error: ACA Magnitude must be between 0 and 10.</p>', unsafe_allow_html=True)
|
193 |
|
194 |
# ACA Axis input
|
195 |
-
aca_axis = st.number_input('Enter ACA Axis:', min_value=0.0, max_value=180.0, step=0.1, value=st.session_state.aca_axis)
|
196 |
if aca_axis != st.session_state.aca_axis:
|
197 |
st.session_state.aca_axis = aca_axis
|
198 |
if aca_axis is not None and (aca_axis < 0 or aca_axis > 180):
|
|
|
102 |
# # unsafe_allow_html=True
|
103 |
# # )
|
104 |
|
105 |
+
# age = st.number_input('Enter Patient Age:', step=0.1)
|
106 |
+
# aca_magnitude = st.number_input('Enter ACA Magnitude:', step=0.1)
|
107 |
+
# aca_axis = st.number_input('Enter ACA Axis:', step=0.1)
|
108 |
|
109 |
# if st.button('Predict!'):
|
110 |
# astigmatism = predict_astigmatism(age, aca_axis, aca_magnitude)
|
|
|
178 |
st.session_state.aca_axis = None
|
179 |
|
180 |
# Age input
|
181 |
+
age = st.number_input('Enter Patient Age (15-90 Years):', min_value=18.0, max_value=90.0, step=0.1, value=st.session_state.age)
|
182 |
if age != st.session_state.age:
|
183 |
st.session_state.age = age
|
184 |
if age is not None and (age < 18 or age > 90):
|
185 |
st.markdown('<p class="error">Error: Age must be between 18 and 90.</p>', unsafe_allow_html=True)
|
186 |
|
187 |
# ACA Magnitude input
|
188 |
+
aca_magnitude = st.number_input('Enter ACA Magnitude (0-10 Diopters):', min_value=0.0, max_value=10.0, step=0.1, value=st.session_state.aca_magnitude)
|
189 |
if aca_magnitude != st.session_state.aca_magnitude:
|
190 |
st.session_state.aca_magnitude = aca_magnitude
|
191 |
if aca_magnitude is not None and (aca_magnitude < 0 or aca_magnitude > 10):
|
192 |
st.markdown('<p class="error">Error: ACA Magnitude must be between 0 and 10.</p>', unsafe_allow_html=True)
|
193 |
|
194 |
# ACA Axis input
|
195 |
+
aca_axis = st.number_input('Enter ACA Axis (0-180 Degrees):', min_value=0.0, max_value=180.0, step=0.1, value=st.session_state.aca_axis)
|
196 |
if aca_axis != st.session_state.aca_axis:
|
197 |
st.session_state.aca_axis = aca_axis
|
198 |
if aca_axis is not None and (aca_axis < 0 or aca_axis > 180):
|