Spaces:
Sleeping
Sleeping
Download app.py from CGdev/CRRA_optimisation_tool: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/spaces/CGdev/CRRA_optimisation_tool/resolve/fbd166f7b60aa4763e9ec44bbde8cd79d526ef36/app.py
- Command line
-
hf download hf://spaces/CGdev/CRRA_optimisation_tool@fbd166f7b60aa4763e9ec44bbde8cd79d526ef36/app.py
-
curl -L -o app.py https://huggingface.co/spaces/CGdev/CRRA_optimisation_tool/resolve/fbd166f7b60aa4763e9ec44bbde8cd79d526ef36/app.py
1.51 kB
| import streamlit as st | |
| from streamlit_option_menu import option_menu | |
| from tabs import (tab0_welcome, tab1_inputs, tab2_constraints, | |
| tab3_coefficients, tab4_optimization, tab5_sensitivity, | |
| tab6_scenarios) | |
| from utils.data_utils import load_slider_data | |
| st.set_page_config("Carbon Portfolio Optimizer", layout="wide") | |
| st.title("Toolkit: CDR Portfolio Optimization") | |
| with st.sidebar: | |
| selected = option_menu( | |
| "Navigation", | |
| options=[ | |
| "Welcome", | |
| "Resource inputs", | |
| "Method constraints", | |
| "Resource coefficients", | |
| "Portfolio generation", | |
| "Sensitivity analysis", | |
| "Scenario comparison", | |
| ], | |
| icons=["house", "upload", "gear", "sliders", "graph-up-arrow", "card-checklist", "search"], | |
| default_index=0, | |
| orientation="vertical" | |
| ) | |
| # Dispatch to appropriate tab | |
| cost_sliders = load_slider_data() | |
| if selected == "Welcome": | |
| tab0_welcome.render_tab() | |
| elif selected == "Resource inputs": | |
| tab1_inputs.render_tab() | |
| elif selected == "Method constraints": | |
| tab2_constraints.render_tab() | |
| elif selected == "Resource coefficients": | |
| tab3_coefficients.render_tab(cost_sliders) | |
| elif selected == "Portfolio generation": | |
| tab4_optimization.render_tab() | |
| elif selected == "Sensitivity analysis": | |
| tab5_sensitivity.render_tab() | |
| elif selected == "Scenario comparison": | |
| tab6_scenarios.render_tab() |