further adjustments where config_provider needs to be called

This commit is contained in:
Fabian Neumann 2024-02-17 17:51:26 +01:00
parent 89d0fa24b6
commit 709b831e06
4 changed files with 9 additions and 6 deletions

View File

@ -47,7 +47,6 @@ RESULTS = "results/" + RDIR
# RESOURCES = "resources/"
localrules:
purge,

View File

@ -15,7 +15,7 @@ rule add_existing_baseyear:
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
costs=resources("costs_{}.csv".format(
config_provider("scenario", "planning_horizons", 0)
config_provider("scenario", "planning_horizons", 0)(w)
)),
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),

View File

@ -584,8 +584,8 @@ if __name__ == "__main__":
plot_balances()
co2_budget = snakemake.params["co2_budget"]
if (
snakemake.params["co2_budget"].startswith("cb")
or snakemake.params["foresight"] == "perfect"
):
isinstance(co2_budget, str) and co2_budget.startswith("cb")
) or snakemake.params["foresight"] == "perfect":
plot_carbon_budget_distribution(snakemake.input.eurostat)

View File

@ -62,7 +62,11 @@ import logging
import numpy as np
import pandas as pd
import pypsa
from _helpers import configure_logging, update_config_from_wildcards, set_scenario_config
from _helpers import (
configure_logging,
set_scenario_config,
update_config_from_wildcards,
)
from add_electricity import load_costs, update_transmission_costs
from pypsa.descriptors import expand_series