Skip to content

Commit

Permalink
follow-up to #1312: avoid use of snakemake in industrial_energy_deman…
Browse files Browse the repository at this point in the history
…d_per_country
  • Loading branch information
fneum committed Sep 20, 2024
1 parent 81da685 commit 9e43aa5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/build_industrial_energy_demand_per_country_today.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
jrc_names = {"GR": "EL", "GB": "UK"}


def industrial_energy_demand_per_country(country, year, jrc_dir):
def industrial_energy_demand_per_country(country, year, jrc_dir, endogenous_ammonia):
jrc_country = jrc_names.get(country, country)
fn = f"{jrc_dir}/{jrc_country}/JRC-IDEES-2021_EnergyBalance_{jrc_country}.xlsx"

Expand All @@ -133,7 +133,8 @@ def get_subsector_data(sheet):

df["hydrogen"] = 0.0

if snakemake.params.ammonia:
# ammonia is handled separately
if endogenous_ammonia:
df["ammonia"] = 0.0

df["other"] = df["all"] - df.loc[df.index != "all"].sum()
Expand Down Expand Up @@ -220,7 +221,10 @@ def industrial_energy_demand(countries, year):
nprocesses = snakemake.threads
disable_progress = snakemake.config["run"].get("disable_progressbar", False)
func = partial(
industrial_energy_demand_per_country, year=year, jrc_dir=snakemake.input.jrc
industrial_energy_demand_per_country,
year=year,
jrc_dir=snakemake.input.jrc,
endogenous_ammonia=snakemake.params.ammonia,
)
tqdm_kwargs = dict(
ascii=False,
Expand Down

0 comments on commit 9e43aa5

Please sign in to comment.