diff --git a/app/tab_certification_schemes.py b/app/tab_certification_schemes.py index c1e9bbc7..f03673d1 100644 --- a/app/tab_certification_schemes.py +++ b/app/tab_certification_schemes.py @@ -4,19 +4,8 @@ import streamlit as st -def content_certification_schemes(context_data: dict): - with st.expander("What is this?"): - st.markdown( - """ -**Get supplementary information on H2-relevant certification frameworks** - -This sheet provides you with an overview of current governmental regulations -and voluntary standards for H2 products. - """ - ) +def _render_scheme_info(context_data, scheme_name): df = context_data["certification_schemes"] - helptext = "Select the certification scheme you want to know more about." - scheme_name = st.selectbox("Select scheme:", df["name"], help=helptext) data = df.loc[df["name"] == scheme_name].iloc[0].to_dict() # replace na with "not specified": @@ -75,3 +64,22 @@ def content_certification_schemes(context_data: dict): with st.expander("**Sources**"): st.markdown(data["sources"]) + + +def content_certification_schemes(context_data: dict): + with st.expander("What is this?"): + st.markdown( + """ +**Get supplementary information on H2-relevant certification frameworks** + +This sheet provides you with an overview of current governmental regulations +and voluntary standards for H2 products. + """ + ) + + helptext = "Select the certification scheme you want to know more about." + scheme_name = st.selectbox( + "Select scheme:", context_data["certification_schemes"]["name"], help=helptext + ) + with st.container(border=True): + _render_scheme_info(context_data=context_data, scheme_name=scheme_name) diff --git a/app/tab_country_fact_sheets.py b/app/tab_country_fact_sheets.py index 50053750..7b4926db 100644 --- a/app/tab_country_fact_sheets.py +++ b/app/tab_country_fact_sheets.py @@ -6,32 +6,6 @@ def _create_fact_sheet_demand_country(context_data: dict): # select country: country_name = st.session_state["country"] - with st.expander("What is this?"): - st.markdown( - """ -**Country fact sheets** - -This sheet provides you with additional information on the production and import of - hydrogen and derivatives in all PTX BOA supply and demand countries. -For each selected supply and demand country pair, you will find detailed - country profiles. - - For demand countries, we cover the following aspects: - country-specific projected hydrogen demand, - target sectors for hydrogen use, - hydrogen-relevant policies and competent authorities, - certification and regulatory frameworks, - and country-specific characteristics as defined in the demand countries' - hydrogen strategies. - - For the supplying countries, we cover the country-specific technical potential - for renewables (based on various data sources), - LNG export and import infrastructure, - CCS potentials, - availability of an H2 strategy - and wholesale electricity prices. - """ - ) df = context_data["demand_countries"] data = df.loc[df["country_name"] == country_name].iloc[0].to_dict() @@ -122,6 +96,33 @@ def _create_fact_sheet_supply_country(context_data: dict): def content_country_fact_sheets(context_data): - _create_fact_sheet_demand_country(context_data) - st.divider() - _create_fact_sheet_supply_country(context_data) + with st.expander("What is this?"): + st.markdown( + """ +**Country fact sheets** + +This sheet provides you with additional information on the production and import of + hydrogen and derivatives in all PTX BOA supply and demand countries. +For each selected supply and demand country pair, you will find detailed + country profiles. + + For demand countries, we cover the following aspects: + country-specific projected hydrogen demand, + target sectors for hydrogen use, + hydrogen-relevant policies and competent authorities, + certification and regulatory frameworks, + and country-specific characteristics as defined in the demand countries' + hydrogen strategies. + + For the supplying countries, we cover the country-specific technical potential + for renewables (based on various data sources), + LNG export and import infrastructure, + CCS potentials, + availability of an H2 strategy + and wholesale electricity prices. + """ + ) + with st.container(border=True): + _create_fact_sheet_demand_country(context_data) + with st.container(border=True): + _create_fact_sheet_supply_country(context_data) diff --git a/app/tab_dashboard.py b/app/tab_dashboard.py index dc8569ca..764fb040 100644 --- a/app/tab_dashboard.py +++ b/app/tab_dashboard.py @@ -36,51 +36,56 @@ def content_dashboard( """ ) - c_1, c_2 = st.columns([2, 1]) + with st.container(border=True): + c_1, c_2 = st.columns([2, 1]) - with c_1: - fig_map = plot_costs_on_map( - api, costs_per_region, scope="world", cost_component="Total" - ) - st.plotly_chart(fig_map, use_container_width=True) + with c_1: + fig_map = plot_costs_on_map( + api, costs_per_region, scope="world", cost_component="Total" + ) + st.plotly_chart(fig_map, use_container_width=True) - with c_2: - # create box plot and bar plot: - fig1 = create_box_plot(costs_per_region) - filtered_data = costs_per_region[ - costs_per_region.index == st.session_state["region"] - ] - fig2 = create_bar_chart_costs(filtered_data) - doublefig = make_subplots(rows=1, cols=2, shared_yaxes=True) + with c_2: + # create box plot and bar plot: + fig1 = create_box_plot(costs_per_region) + filtered_data = costs_per_region[ + costs_per_region.index == st.session_state["region"] + ] + fig2 = create_bar_chart_costs(filtered_data) + doublefig = make_subplots(rows=1, cols=2, shared_yaxes=True) - for trace in fig1.data: - trace.showlegend = False - doublefig.add_trace(trace, row=1, col=1) - for trace in fig2.data: - doublefig.add_trace(trace, row=1, col=2) + for trace in fig1.data: + trace.showlegend = False + doublefig.add_trace(trace, row=1, col=1) + for trace in fig2.data: + doublefig.add_trace(trace, row=1, col=2) - doublefig.update_layout(barmode="stack") - doublefig.update_layout(title_text="Cost distribution and details:") - st.plotly_chart(doublefig, use_container_width=True) + doublefig.update_layout(barmode="stack") + doublefig.update_layout(title_text="Cost distribution and details:") + st.plotly_chart(doublefig, use_container_width=True) - st.button( - "More Info on Supply Region and Demand Country", - on_click=move_to_tab, - args=("Country fact sheets",), - ) + st.button( + "More Info on Supply Region and Demand Country", + on_click=move_to_tab, + args=("Country fact sheets",), + ) - display_costs( - remove_subregions(api, costs_per_region, st.session_state["country"]), - "region", - "Costs by region:", - ) + with st.container(border=True): + display_costs( + remove_subregions(api, costs_per_region, st.session_state["country"]), + "region", + "Costs by region:", + ) - display_costs(costs_per_scenario, "scenario", "Costs by data scenario:") + with st.container(border=True): + display_costs(costs_per_scenario, "scenario", "Costs by data scenario:") - display_costs( - costs_per_res_gen, "res_gen", "Costs by renewable electricity source:" - ) + with st.container(border=True): + display_costs( + costs_per_res_gen, "res_gen", "Costs by renewable electricity source:" + ) - display_costs( - costs_per_chain, "chain", "Costs by supply chain:", output_unit="USD/MWh" - ) + with st.container(border=True): + display_costs( + costs_per_chain, "chain", "Costs by supply chain:", output_unit="USD/MWh" + ) diff --git a/app/tab_deep_dive_countries.py b/app/tab_deep_dive_countries.py index 9cf3656a..8a31d723 100644 --- a/app/tab_deep_dive_countries.py +++ b/app/tab_deep_dive_countries.py @@ -42,54 +42,58 @@ def content_deep_dive_countries(api: PtxboaAPI, costs_per_region: pd.DataFrame) "Select country:", ["Argentina", "Morocco", "South Africa"], horizontal=True ) - fig_map = plot_costs_on_map( - api, costs_per_region, scope=ddc, cost_component="Total" - ) - st.plotly_chart(fig_map, use_container_width=True) - - display_costs( - select_subregions(costs_per_region, ddc), - key="region", - titlestring="Costs per subregion", - key_suffix=ddc, - ) + with st.container(border=True): + fig_map = plot_costs_on_map( + api, costs_per_region, scope=ddc, cost_component="Total" + ) + st.plotly_chart(fig_map, use_container_width=True) - st.subheader("Full load hours of renewable generation") + st.divider() - # in order to keep the figures horizontally aligned, we create two st.columns pairs - # the columns are identified by c_{row}_{column}, zero indexed - c_0_0, c_0_1 = st.columns([2, 1], gap="large") - c_1_0, c_1_1 = st.columns([2, 1], gap="large") - with c_0_0: - st.markdown("**Map**") - map_parameter = st.selectbox( - "Show Parameter on Map", - [ - "Wind Onshore", - "Wind Offshore", - "PV tilted", - "Wind-PV-Hybrid", - ], - key="ddc_flh_map_parameter", - ) - with c_1_0: - fig = plot_input_data_on_map( - api=api, - data_type="full load hours", - color_col=map_parameter, - scope=ddc, - ) - st.plotly_chart(fig, use_container_width=True) - with st.expander("**Data**"): - df = display_and_edit_input_data( - api, - data_type="full load hours", - scope=ddc, - key="input_data_editor_full_load_hours_ddc", + display_costs( + select_subregions(costs_per_region, ddc), + key="region", + titlestring="Costs per subregion", + key_suffix=ddc, ) - with c_0_1: - st.markdown("**Regional Distribution**") - with c_1_1: - fig = px.box(df) - st.plotly_chart(fig, use_container_width=True) + with st.container(border=True): + st.subheader("Full load hours of renewable generation") + + # in order to keep the figures horizontally aligned, we create two st.columns + # pairs, the columns are identified by c_{row}_{column}, zero indexed + c_0_0, c_0_1 = st.columns([2, 1], gap="large") + c_1_0, c_1_1 = st.columns([2, 1], gap="large") + with c_0_0: + st.markdown("**Map**") + map_parameter = st.selectbox( + "Show Parameter on Map", + [ + "Wind Onshore", + "Wind Offshore", + "PV tilted", + "Wind-PV-Hybrid", + ], + key="ddc_flh_map_parameter", + ) + with c_1_0: + fig = plot_input_data_on_map( + api=api, + data_type="full load hours", + color_col=map_parameter, + scope=ddc, + ) + st.plotly_chart(fig, use_container_width=True) + with st.expander("**Data**"): + df = display_and_edit_input_data( + api, + data_type="full load hours", + scope=ddc, + key="input_data_editor_full_load_hours_ddc", + ) + + with c_0_1: + st.markdown("**Regional Distribution**") + with c_1_1: + fig = px.box(df) + st.plotly_chart(fig, use_container_width=True) diff --git a/app/tab_input_data.py b/app/tab_input_data.py index dfb124c1..bdf4c811 100644 --- a/app/tab_input_data.py +++ b/app/tab_input_data.py @@ -34,73 +34,74 @@ def content_input_data(api: PtxboaAPI) -> None: """ ) - st.subheader("Region specific data") + with st.container(border=True): + st.subheader("Region specific data") - data_selection = st.radio( - "Select data type", - ["CAPEX", "full load hours", "interest rate"], - horizontal=True, - ) + data_selection = st.radio( + "Select data type", + ["CAPEX", "full load hours", "interest rate"], + horizontal=True, + ) - # in order to keep the figures horizontally aligned, we create two st.columns pairs - # the columns are identified by c_{row}_{column}, zero indexed - c_0_0, c_0_1 = st.columns([2, 1], gap="large") - c_1_0, c_1_1 = st.columns([2, 1], gap="large") - with c_0_0: - st.markdown("**Map**") - if data_selection in ["full load hours", "CAPEX"]: - map_parameter = st.selectbox( - "Show Parameter on Map", - [ - "Wind Onshore", - "Wind Offshore", - "PV tilted", - "Wind-PV-Hybrid", - ], - key="input_data_map_parameter", + # in order to keep the figures horizontally aligned, we create two st.columns + # pairs the columns are identified by c_{row}_{column}, zero indexed + c_0_0, c_0_1 = st.columns([2, 1], gap="large") + c_1_0, c_1_1 = st.columns([2, 1], gap="large") + with c_0_0: + st.markdown("**Map**") + if data_selection in ["full load hours", "CAPEX"]: + map_parameter = st.selectbox( + "Show Parameter on Map", + [ + "Wind Onshore", + "Wind Offshore", + "PV tilted", + "Wind-PV-Hybrid", + ], + key="input_data_map_parameter", + ) + else: + map_parameter = "interest rate" + with c_1_0: + fig = plot_input_data_on_map( + api=api, + data_type=data_selection, + color_col=map_parameter, + scope="world", ) - else: - map_parameter = "interest rate" - with c_1_0: - fig = plot_input_data_on_map( - api=api, - data_type=data_selection, - color_col=map_parameter, - scope="world", - ) - st.plotly_chart(fig, use_container_width=True) + st.plotly_chart(fig, use_container_width=True) - with st.expander("**Data**"): - df = display_and_edit_input_data( - api, - data_type=data_selection, - scope="world", - key=f"input_data_editor_{data_selection}", - ) - with c_0_1: - st.markdown("**Regional Distribution**") - with c_1_1: - # create plot: - fig = px.box(df) - st.plotly_chart(fig, use_container_width=True) + with st.expander("**Data**"): + df = display_and_edit_input_data( + api, + data_type=data_selection, + scope="world", + key=f"input_data_editor_{data_selection}", + ) + with c_0_1: + st.markdown("**Regional Distribution**") + with c_1_1: + # create plot: + fig = px.box(df) + st.plotly_chart(fig, use_container_width=True) - st.divider() - st.subheader("Data that is identical for all regions") + with st.container(border=True): + st.subheader("Data that is identical for all regions") - st.markdown("**Conversion processes:**") - with st.expander("**Data**"): - display_and_edit_input_data( - api, - data_type="conversion_processes", - scope=None, - key="input_data_editor_conversion_processes", - ) - st.markdown("**Transportation processes:**") - with st.expander("**Data**"): - st.markdown("TODO: fix data") - display_and_edit_input_data( - api, - data_type="transportation_processes", - scope=None, - key="input_data_editor_transportation_processes", - ) + st.markdown("**Conversion processes:**") + with st.expander("**Data**"): + display_and_edit_input_data( + api, + data_type="conversion_processes", + scope=None, + key="input_data_editor_conversion_processes", + ) + st.markdown("**Transportation processes:**") + with st.expander("**Data**"): + st.markdown("TODO: fix data") + display_and_edit_input_data( + api, + data_type="transportation_processes", + scope=None, + key="input_data_editor_transportation_processes", + ) diff --git a/app/tab_literature.py b/app/tab_literature.py index fe0eebf0..3be17a9b 100644 --- a/app/tab_literature.py +++ b/app/tab_literature.py @@ -27,6 +27,7 @@ def content_literature(context_data: dict): This tab contains a list of references used in this app. """ ) + st.markdown("## References") df = context_data["literature"] markdown_text = "" for _ind, row in df.iterrows(): diff --git a/app/tab_sustainability.py b/app/tab_sustainability.py index 30890832..7402ab66 100644 --- a/app/tab_sustainability.py +++ b/app/tab_sustainability.py @@ -3,65 +3,46 @@ import streamlit as st -def content_sustainability(context_data: dict): - with st.expander("What is this?"): - st.markdown( - """ -**Get supplementary information on PTX-relevant sustainability issues** - -Hydrogen is not sustainable by nature. -And sustainability goes far beyond the CO2-footprint of a product. -It also includes other environmental as well as socio-economic dimensions. - -This is why we provide you with a set of questions that will help you assess your plans -for PTX production and export from a comprehensive sustainability perspective. -Please note that this list does not claim to be exhaustive, -but only serves for an orientation on the topic. - """ - ) - df = context_data["sustainability"] - - c1, c2 = st.columns([2, 1]) - with c1: - st.image("static/sustainability.png") - captiontext = ( - "Source: https://ptx-hub.org/wp-content/uploads/2022/05/" - "PtX-Hub-PtX.Sustainability-Dimensions-and-Concerns-Scoping-Paper.pdf" - ) - st.caption(captiontext) - with c2: - st.markdown( - """ -**Dimensions of sustainability** +def _render_figure_and_introduction(): + st.image("static/sustainability.png") + captiontext = ( + "Source: https://ptx-hub.org/wp-content/uploads/2022/05/" + "PtX-Hub-PtX.Sustainability-Dimensions-and-Concerns-Scoping-Paper.pdf" + ) + st.caption(captiontext) + st.markdown( + """ **What sustainability aspects should be considered for PTX products, - production and policies?** +production and policies?** **What questions should be asked before and during project development?** In this tab we aim to provide a basic approach to these questions. - To the left, you can see the framework along which the compilation - of sustainability aspects in this tab is structured. It is based on the EESG framework - as elaborated by the PtX Hub and sustainability criteria developed by the Öko-Institut. +To the left, you can see the framework along which the compilation +of sustainability aspects in this tab is structured. It is based on the EESG framework +as elaborated by the PtX Hub and sustainability criteria developed by the Öko-Institut. **The framework distinguishes four key sustainability dimensions - Environmental, - Economic, Social and Governance - from which you can select below.** +Economic, Social and Governance - from which you can select below.** - Within each of these dimensions there are different clusters of sustainability aspects - that we address in a set of questions. We differentiate between questions indicating - guardrails and questions suggesting goals. +Within each of these dimensions there are different clusters of sustainability aspects +that we address in a set of questions. We differentiate between questions indicating +guardrails and questions suggesting goals. With this compilation, we aim to provide a general overview of the sustainability - issues that may be relevant in the context of PTX production. Of course, - different aspects are more or less important depending on the project, - product and country. +issues that may be relevant in the context of PTX production. Of course, +different aspects are more or less important depending on the project, +product and country. **Take a look for yourself to see which dimensions are most important - from where you are coming from.** +from where you are coming from.** """ - ) - st.divider() + ) + +def _interactive_sustainability_dimension_info(context_data: dict): + df = context_data["sustainability"] c1, c2 = st.columns(2) with c1: helptext = "helptext" @@ -74,9 +55,9 @@ def content_sustainability(context_data: dict): PTX products that are sustainable also beyond their greenhouse gas emission intensity. **Goals** are guidelines which can help link PTX production to improving local - ecological and socio-economic circumstances in the supply country. +ecological and socio-economic circumstances in the supply country. They act as additional to guardrails which should be fulfilled in the first place - to meet basic sustainability needs. +to meet basic sustainability needs. """ question_type = st.radio( "Guardrails or goals?", @@ -91,3 +72,28 @@ def content_sustainability(context_data: dict): data_select = data.loc[data["topic"] == topic] for _ind, row in data_select.iterrows(): st.markdown(f"- {row['question']}") + + +def content_sustainability(context_data: dict): + with st.expander("What is this?"): + st.markdown( + """ +**Get supplementary information on PTX-relevant sustainability issues** + +Hydrogen is not sustainable by nature. +And sustainability goes far beyond the CO2-footprint of a product. +It also includes other environmental as well as socio-economic dimensions. + +This is why we provide you with a set of questions that will help you assess your plans +for PTX production and export from a comprehensive sustainability perspective. +Please note that this list does not claim to be exhaustive, +but only serves for an orientation on the topic. + """ + ) + + st.markdown("## Dimensions of sustainability") + with st.container(border=True): + _render_figure_and_introduction() + + with st.container(border=True): + _interactive_sustainability_dimension_info(context_data)