HaLim
commited on
Commit
Β·
3d08e0e
1
Parent(s):
868114c
update streamlit to have demand data validation
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ st.sidebar.markdown("---")
|
|
| 25 |
# Navigation
|
| 26 |
page = st.sidebar.selectbox(
|
| 27 |
"Navigate to:",
|
| 28 |
-
["βοΈ Settings", "π Optimization Results"],
|
| 29 |
index=0
|
| 30 |
)
|
| 31 |
|
|
@@ -40,5 +40,37 @@ if page == "βοΈ Settings":
|
|
| 40 |
render_config_page()
|
| 41 |
|
| 42 |
elif page == "π Optimization Results":
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Navigation
|
| 26 |
page = st.sidebar.selectbox(
|
| 27 |
"Navigate to:",
|
| 28 |
+
["βοΈ Settings", "π Optimization Results", "π Demand Validation"],
|
| 29 |
index=0
|
| 30 |
)
|
| 31 |
|
|
|
|
| 40 |
render_config_page()
|
| 41 |
|
| 42 |
elif page == "π Optimization Results":
|
| 43 |
+
# Import and render the optimization results page
|
| 44 |
+
from optimization_results import display_optimization_results
|
| 45 |
+
|
| 46 |
+
# Check if we have results in session state
|
| 47 |
+
if 'optimization_results' in st.session_state and st.session_state.optimization_results:
|
| 48 |
+
display_optimization_results(st.session_state.optimization_results)
|
| 49 |
+
else:
|
| 50 |
+
st.title("π Optimization Results")
|
| 51 |
+
st.info("π No optimization results available yet.")
|
| 52 |
+
st.markdown("Please run an optimization from the **βοΈ Settings** page first to see results here.")
|
| 53 |
+
|
| 54 |
+
# Add helpful instructions
|
| 55 |
+
st.markdown("### π How to Get Results:")
|
| 56 |
+
st.markdown("1. Go to **βοΈ Settings** page")
|
| 57 |
+
st.markdown("2. Configure your optimization parameters")
|
| 58 |
+
st.markdown("3. Click **π Optimize Schedule**")
|
| 59 |
+
st.markdown("4. Return here to view detailed results and input data inspection")
|
| 60 |
+
|
| 61 |
+
elif page == "π Demand Validation":
|
| 62 |
+
# Import and render the demand validation page
|
| 63 |
+
try:
|
| 64 |
+
from src.demand_validation import display_demand_validation
|
| 65 |
+
|
| 66 |
+
st.title("π Demand Data Validation")
|
| 67 |
+
st.markdown("---")
|
| 68 |
+
|
| 69 |
+
display_demand_validation()
|
| 70 |
+
|
| 71 |
+
except ImportError as e:
|
| 72 |
+
st.error(f"β Error loading demand validation module: {str(e)}")
|
| 73 |
+
st.info("π‘ Please ensure the demand validation module is properly installed.")
|
| 74 |
+
except Exception as e:
|
| 75 |
+
st.error(f"β Error in demand validation: {str(e)}")
|
| 76 |
+
st.info("π‘ Please check the data files and configuration.")
|