Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change default options in sidebar #147

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions app/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def make_sidebar(api: PtxboaAPI):
"(RE source, mode of transportation). For other regions, "
"default settings will be used."
),
index=region_list.get_loc("Morocco"), # Morocco as default
)
st.sidebar.toggle(
"Include subregions",
Expand All @@ -38,13 +39,16 @@ def make_sidebar(api: PtxboaAPI):
),
key="include_subregions",
)

countries = api.get_dimension("country").index
st.session_state["country"] = st.sidebar.selectbox(
"Demand country:",
api.get_dimension("country").index,
countries,
help=(
"The country you aim to export to. Some key info on the demand country you "
"choose here are displayed in the info box."
),
index=countries.get_loc("Germany"),
)
# get chain as combination of product, electrolyzer type and reconversion option:
c1, c2 = st.sidebar.columns(2)
Expand All @@ -61,6 +65,7 @@ def make_sidebar(api: PtxboaAPI):
"Ft e-fuels",
],
help="The product you want to export.",
index=4, # Methane as default
)
with c2:
ely = st.selectbox(
Expand All @@ -71,6 +76,7 @@ def make_sidebar(api: PtxboaAPI):
"SEOC",
],
help="The electrolyzer type you wish to use.",
index=0, # AEL as default
)
if product in ["Ammonia", "Methane"]:
use_reconversion = st.sidebar.toggle(
Expand Down Expand Up @@ -138,20 +144,25 @@ def make_sidebar(api: PtxboaAPI):
)
st.session_state["transport"] = st.sidebar.radio(
"Mode of transportation (for selected supply country):",
api.get_dimension("transport").index,
["Ship", "Pipeline"],
markushal marked this conversation as resolved.
Show resolved Hide resolved
horizontal=True,
help="Help text",
index=1, # 'Pipeline' as default
)
if st.session_state["transport"] == "Ship":
st.session_state["ship_own_fuel"] = st.sidebar.toggle(
"For shipping option: Use the product as own fuel?",
help="Help text",
)
else:
st.session_state["ship_own_fuel"] = False

st.session_state["output_unit"] = st.sidebar.radio(
"Unit for delivered costs:",
api.get_dimension("output_unit").index,
["USD/MWh", "USD/t"],
horizontal=True,
help="Help text",
index=1, # 'USD/t' as default
)

st.sidebar.toggle(
Expand Down