From f8acb8dbd90322c182f19c36d4db0cdf12cfc446 Mon Sep 17 00:00:00 2001 From: energyls Date: Tue, 31 Oct 2023 11:48:41 +0100 Subject: [PATCH 1/5] feat: add option for land transport depending on co2L --- scripts/prepare_sector_network.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 87684f29..a13a70c9 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1394,13 +1394,24 @@ def add_land_transport(n, costs): print("adding land transport") - fuel_cell_share = get( - options["land_transport_fuel_cell_share"], - demand_sc + "_" + str(investment_year), - ) - electric_share = get( - options["land_transport_electric_share"], demand_sc + "_" + str(investment_year) - ) + if options["dynamic_transport"]["enable"] == False: + fuel_cell_share = get( + options["land_transport_fuel_cell_share"], + demand_sc + "_" + str(investment_year), + ) + electric_share = get( + options["land_transport_electric_share"], + demand_sc + "_" + str(investment_year), + ) + + elif options["dynamic_transport"]["enable"] == True: + fuel_cell_share = options["dynamic_transport"][ + "land_transport_fuel_cell_share" + ][snakemake.wildcards.opts] + electric_share = options["dynamic_transport"]["land_transport_electric_share"][ + snakemake.wildcards.opts + ] + ice_share = 1 - fuel_cell_share - electric_share print("FCEV share", fuel_cell_share) From 9f9564025f680771caf08364e2adc86cc8296b10 Mon Sep 17 00:00:00 2001 From: energyls Date: Tue, 31 Oct 2023 11:49:05 +0100 Subject: [PATCH 2/5] feat: add config option for land transport and co2L --- config.default.yaml | 29 +++++++++++++++++++++++++++++ test/config.test1.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/config.default.yaml b/config.default.yaml index 708e8266..cdcd0f7b 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -224,6 +224,35 @@ sector: efficiency_heat_biomass_to_elec: 0.9 efficiency_heat_gas_to_elec: 0.9 + dynamic_transport: + enable: True # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") + land_transport_electric_share: + Co2L2.0: 0.00 + Co2L1.0: 0.01 + Co2L0.90: 0.03 + Co2L0.80: 0.06 + Co2L0.70: 0.10 + Co2L0.60: 0.17 + Co2L0.50: 0.27 + Co2L0.40: 0.40 + Co2L0.30: 0.55 + Co2L0.20: 0.69 + Co2L0.10: 0.80 + Co2L0.00: 0.88 + land_transport_fuel_cell_share: + Co2L2.0: 0.01 + Co2L1.0: 0.01 + Co2L0.90: 0.01 + Co2L0.80: 0.01 + Co2L0.70: 0.01 + Co2L0.60: 0.01 + Co2L0.50: 0.01 + Co2L0.40: 0.01 + Co2L0.30: 0.01 + Co2L0.20: 0.01 + Co2L0.10: 0.01 + Co2L0.00: 0.01 + land_transport_fuel_cell_share: # 1 means all FCEVs HERE BU_2030: 0.00 AP_2030: 0.004 diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 3d643b73..616ec175 100644 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -225,6 +225,35 @@ sector: efficiency_heat_biomass_to_elec: 0.9 efficiency_heat_gas_to_elec: 0.9 + dynamic_transport: + enable: True # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") + land_transport_electric_share: + Co2L2.0: 0.00 + Co2L1.0: 0.01 + Co2L0.90: 0.03 + Co2L0.80: 0.06 + Co2L0.70: 0.10 + Co2L0.60: 0.17 + Co2L0.50: 0.27 + Co2L0.40: 0.40 + Co2L0.30: 0.55 + Co2L0.20: 0.69 + Co2L0.10: 0.80 + Co2L0.00: 0.88 + land_transport_fuel_cell_share: + Co2L2.0: 0.01 + Co2L1.0: 0.01 + Co2L0.90: 0.01 + Co2L0.80: 0.01 + Co2L0.70: 0.01 + Co2L0.60: 0.01 + Co2L0.50: 0.01 + Co2L0.40: 0.01 + Co2L0.30: 0.01 + Co2L0.20: 0.01 + Co2L0.10: 0.01 + Co2L0.00: 0.01 + land_transport_fuel_cell_share: # 1 means all FCEVs HERE BU_2030: 0.00 AP_2030: 0.004 From a86d22d73b579236dd7c3e92adcb1befff3aa905 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:51:26 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- config.default.yaml | 4 ++-- test/config.test1.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index cdcd0f7b..13bcd31c 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -224,8 +224,8 @@ sector: efficiency_heat_biomass_to_elec: 0.9 efficiency_heat_gas_to_elec: 0.9 - dynamic_transport: - enable: True # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") + dynamic_transport: + enable: true # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") land_transport_electric_share: Co2L2.0: 0.00 Co2L1.0: 0.01 diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 616ec175..46ebd934 100644 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -226,7 +226,7 @@ sector: efficiency_heat_gas_to_elec: 0.9 dynamic_transport: - enable: True # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") + enable: true # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") land_transport_electric_share: Co2L2.0: 0.00 Co2L1.0: 0.01 From a067348f362de5e79848cef7802a522ea73582ea Mon Sep 17 00:00:00 2001 From: energyls Date: Wed, 8 Nov 2023 13:29:51 +0100 Subject: [PATCH 4/5] fix: turn off dynamic transport for CI --- test/config.test1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 46ebd934..5ed99593 100644 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -226,7 +226,7 @@ sector: efficiency_heat_gas_to_elec: 0.9 dynamic_transport: - enable: true # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") + enable: False # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") land_transport_electric_share: Co2L2.0: 0.00 Co2L1.0: 0.01 From e370e21edbfe4ce2cda6e7e0f1d10011e4f23447 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 12:30:14 +0000 Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- test/config.test1.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 5ed99593..c2c0469e 100644 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -226,7 +226,7 @@ sector: efficiency_heat_gas_to_elec: 0.9 dynamic_transport: - enable: False # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") + enable: false # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08") land_transport_electric_share: Co2L2.0: 0.00 Co2L1.0: 0.01