Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
def evaluate_erosion_protection(dispersive, sand, height, slope_angle):
|
| 4 |
+
if dispersive:
|
| 5 |
+
if height <= 3:
|
| 6 |
+
return "mattress"
|
| 7 |
+
else: # height > 3
|
| 8 |
+
if slope_angle <= 15:
|
| 9 |
+
return "mattress"
|
| 10 |
+
else:
|
| 11 |
+
return "soil bag"
|
| 12 |
+
else: # not dispersive
|
| 13 |
+
if sand:
|
| 14 |
+
if height <= 3:
|
| 15 |
+
return "geofabric"
|
| 16 |
+
else: # height > 3
|
| 17 |
+
if slope_angle <= 15:
|
| 18 |
+
return "geofabric"
|
| 19 |
+
else:
|
| 20 |
+
return "soil bag"
|
| 21 |
+
else: # not sand
|
| 22 |
+
if height <= 6:
|
| 23 |
+
if slope_angle <= 30:
|
| 24 |
+
return "sodding"
|
| 25 |
+
else:
|
| 26 |
+
return "geofabric"
|
| 27 |
+
else: # height > 6
|
| 28 |
+
return "geofabric"
|
| 29 |
+
|
| 30 |
+
st.title("Erosion Protection Method Evaluator")
|
| 31 |
+
|
| 32 |
+
st.write("This app helps you determine the recommended method for erosion protection based on soil and slope characteristics.")
|
| 33 |
+
|
| 34 |
+
dispersive = st.checkbox("Is the soil dispersive?")
|
| 35 |
+
sand = st.checkbox("Is the soil sand?")
|
| 36 |
+
height = st.number_input("Enter the height of the slope (in meters)", min_value=0.0, value=1.0, step=0.1)
|
| 37 |
+
slope_angle = st.number_input("Enter the slope angle (in degrees)", min_value=0.0, max_value=90.0, value=15.0, step=0.1)
|
| 38 |
+
|
| 39 |
+
if st.button("Evaluate"):
|
| 40 |
+
method = evaluate_erosion_protection(dispersive, sand, height, slope_angle)
|
| 41 |
+
st.write(f"The recommended erosion protection method is: **{method}**")
|
| 42 |
+
|
| 43 |
+
st.sidebar.header("About")
|
| 44 |
+
st.sidebar.info("This app uses a decision tree model to recommend erosion protection methods based on soil characteristics and slope geometry.")
|
| 45 |
+
st.sidebar.warning("Always consult with a geotechnical engineer for professional advice on erosion control measures.")
|