From 3233fa7166ff46e4aa191abfb08c0ef9535f8abf Mon Sep 17 00:00:00 2001 From: Hazem-IEG Date: Wed, 17 Jul 2024 19:03:36 +0200 Subject: [PATCH] adapt build_base_energy and build_base_industry to params --- scripts/build_base_energy_totals.py | 8 ++++---- scripts/build_base_industry_totals.py | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/build_base_energy_totals.py b/scripts/build_base_energy_totals.py index 66f96a97..9cb6d473 100644 --- a/scripts/build_base_energy_totals.py +++ b/scripts/build_base_energy_totals.py @@ -132,7 +132,7 @@ def calc_sector(sector): sectors_dfs[sector] = df_sector.copy() if sector == "consumption by households": - if snakemake.config["sector"]["coal"]["shift_to_elec"]: + if snakemake.params.shift_coal_to_elec: condition = (df_sector.Commodity == "Electricity") | ( df_sector.Commodity.isin(coal_fuels) ) @@ -165,7 +165,7 @@ def calc_sector(sector): ) * (1 - snakemake.params.space_heat_share) elif sector == "services": - if snakemake.config["sector"]["coal"]["shift_to_elec"]: + if snakemake.params.shift_coal_to_elec: condition = (df_sector.Commodity == "Electricity") | ( df_sector.Commodity.isin(coal_fuels) ) @@ -289,7 +289,7 @@ def calc_sector(sector): 4, ) elif sector == "other energy": - if snakemake.config["sector"]["coal"]["shift_to_elec"]: + if snakemake.params.shift_coal_to_elec: condition = (df_sector.Commodity == "Electricity") | ( df_sector.Commodity.isin(coal_fuels) ) @@ -318,7 +318,7 @@ def calc_sector(sector): 4, ) elif sector == "non energy use": - if snakemake.config["sector"]["coal"]["shift_to_elec"]: + if snakemake.params.shift_coal_to_elec: condition = (df_sector.Commodity == "Electricity") | ( df_sector.Commodity.isin(coal_fuels) ) diff --git a/scripts/build_base_industry_totals.py b/scripts/build_base_industry_totals.py index 1cad49cd..19f9776d 100644 --- a/scripts/build_base_industry_totals.py +++ b/scripts/build_base_industry_totals.py @@ -103,8 +103,6 @@ def create_industry_base_totals(df): year = snakemake.params.base_year countries = snakemake.params.countries - transactions_from_list = snakemake.config["industry"] - investment_year = int(snakemake.wildcards.planning_horizons) demand_sc = snakemake.wildcards.demand no_years = int(snakemake.wildcards.planning_horizons) - int(