Skip to content

Commit

Permalink
adapting workflow for other countries
Browse files Browse the repository at this point in the history
  • Loading branch information
hazemakhalek committed Aug 24, 2023
1 parent cce5c48 commit 54c68ee
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions data/demand/efficiency_gains.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
,total residential space,total residential water,electricity residential,total services space,total services water,total rail,electricity rail,total domestic aviation,total international aviation,total domestic navigation,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass,residential gas,agriculture biomass,services oil,services biomass,services gas,total road ev,total road fcev,total road ice,total navigation oil,total navigation hydrogen,residential heat biomass,residential heat oil,residential heat gas
MA,0.91,0.82,0.95,0.88,0.71,0.91,0.96,1.0,1.0,0.71,100,0.95,0.95,0.88,1.0,0.91,0.82,0.79,1.0,0.9,1.0, 0.3, 0.6, 1.0, 0.98, 0.85, 0.95, 0.95, 1.0
NG,0.91,0.82,0.95,0.88,0.71,0.91,0.96,1.0,1.0,0.71,100,0.95,0.95,0.88,1.0,0.91,0.82,0.79,1.0,0.9,1.0, 0.3, 0.6, 1.0, 0.98, 0.85, 0.95, 0.95, 1.0
BJ,0.91,0.82,0.95,0.88,0.71,0.91,0.96,1.0,1.0,0.71,100,0.95,0.95,0.88,1.0,0.91,0.82,0.79,1.0,0.9,1.0, 0.3, 0.6, 1.0, 0.98, 0.85, 0.95, 0.95, 1.0
3 changes: 3 additions & 0 deletions data/demand/fuel_shares.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
country,oil residential heat share,biomass residential heat share,biomass to elec heat share,oil to elec heat share,biomass to elec share,oil to elec share,space to water heat share,gas to elec share,gas to elec heat share,gas residential heat share
MA, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75
NG, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75
BJ, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75

2 changes: 2 additions & 0 deletions data/demand/growth_factors.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
,total residential space,total residential water,electricity residential,total services space,total services water,total road,total rail,electricity rail,total domestic aviation,total international aviation,total domestic navigation,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass,residential gas,agriculture biomass,services oil,services biomass,services gas,residential heat oil,residential heat biomass,residential heat gas
MA,1.5,1.6,2.8,1.4,1.5,1.3,2.5,2.1,2.0,1.5,1.13,1.6,2.0,1.5,0.7,1.0,1.0,1.23,1.32,0.5,1.0,0.89, 1.0, 1.0, 1.0
NG,1.5,1.6,2.8,1.4,1.5,1.3,2.5,2.1,2.0,1.5,1.13,1.6,2.0,1.5,0.7,1.0,1.0,1.23,1.32,0.5,1.0,0.89, 1.0, 1.0, 1.0
BJ,1.5,1.6,2.8,1.4,1.5,1.3,2.5,2.1,2.0,1.5,1.13,1.6,2.0,1.5,0.7,1.0,1.0,1.23,1.32,0.5,1.0,0.89, 1.0, 1.0, 1.0
1 change: 1 addition & 0 deletions scripts/build_base_energy_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ def calc_sector(sector):
# Fetch country list and demand base year from the config file
year = snakemake.config["demand_data"]["base_year"]
countries = snakemake.config["countries"]
#countries = ["NG", "BJ"]

# Filter for the year and country
df_yr = df[df.Year == year]
Expand Down
17 changes: 13 additions & 4 deletions scripts/prepare_energy_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,30 @@ def get(item, investment_year=None):
"prepare_energy_totals",
simpl="",
clusters=10,
demand="XX",
planning_horizons=2038,
demand="AB",
planning_horizons=2030,
)
sets_path_to_root("pypsa-earth-sec")

countries = snakemake.config["countries"]
#countries = ["NG", "BJ"]
investment_year = int(snakemake.wildcards.planning_horizons)
demand_sc = snakemake.wildcards.demand # loading the demand scenrario wildcard

base_energy_totals = pd.read_csv("data/energy_totals_base.csv", index_col=0)
growth_factors = pd.read_csv("data/demand/growth_factors.csv", index_col=0)
efficiency_gains = pd.read_csv("data/demand/efficiency_gains.csv", index_col=0)
fuel_shares = pd.read_csv("data/demand/fuel_shares.csv", index_col=0)
district_heating = pd.read_csv("data/demand/district_heating.csv", index_col=0)

growth_factors = growth_factors[growth_factors.index.isin(countries)]
efficiency_gains = efficiency_gains[efficiency_gains.index.isin(countries)]
fuel_shares = fuel_shares[fuel_shares.index.isin(countries)]
district_heating = district_heating[district_heating.index.isin(countries)]

options = snakemake.config["sector"]

investment_year = int(snakemake.wildcards.planning_horizons)
demand_sc = snakemake.wildcards.demand # loading the demand scenrario wildcard


fuel_cell_share = get(
options["land_transport_fuel_cell_share"],
Expand Down

0 comments on commit 54c68ee

Please sign in to comment.