[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-09-15 09:56:15 +00:00
parent 7be8cc0773
commit 668ec9efad
5 changed files with 43 additions and 39 deletions

View File

@ -21,9 +21,9 @@ if config["enable"].get("prepare_links_p_nom", False):
rule build_electricity_demand:
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
countries=config["countries"],
load=config["load"],
@ -66,9 +66,9 @@ rule base_network:
params:
countries=config["countries"],
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
lines=config["lines"],
links=config["links"],
@ -153,9 +153,9 @@ if config["enable"].get("build_cutout", False):
rule build_cutout:
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
cutouts=config["atlite"]["cutouts"],
input:
@ -483,8 +483,8 @@ rule add_extra_components:
rule prepare_network:
params:
snapshots={
"resolution":config["snapshots"].get("resolution", False),
"segmentation":config["snapshots"].get("segmentation", False),
"resolution": config["snapshots"].get("resolution", False),
"segmentation": config["snapshots"].get("segmentation", False),
},
links=config["links"],
lines=config["lines"],

View File

@ -142,9 +142,9 @@ if not (config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]):
rule build_heat_demands:
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
input:
pop_layout=RESOURCES + "pop_layout_{scope}.nc",
@ -168,9 +168,9 @@ rule build_heat_demands:
rule build_temperature_profiles:
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
input:
pop_layout=RESOURCES + "pop_layout_{scope}.nc",
@ -224,9 +224,9 @@ rule build_cop_profiles:
rule build_solar_thermal_profiles:
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
solar_thermal=config["solar_thermal"],
input:
@ -690,9 +690,9 @@ rule build_shipping_demand:
rule build_transport_demand:
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
sector=config["sector"],
input:

View File

@ -56,9 +56,9 @@ rule make_summary:
foresight=config["foresight"],
costs=config["costs"],
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
scenario=config["scenario"],
RDIR=RDIR,

View File

@ -18,9 +18,9 @@ rule build_electricity_production:
"""
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
countries=config["countries"],
output:
@ -40,9 +40,9 @@ rule build_cross_border_flows:
"""
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
countries=config["countries"],
input:
@ -64,9 +64,9 @@ rule build_electricity_prices:
"""
params:
snapshots={
"start":config["snapshots"]["start"],
"end":config["snapshots"]["end"],
"inclusive":config["snapshots"]["inclusive"],
"start": config["snapshots"]["start"],
"end": config["snapshots"]["end"],
"inclusive": config["snapshots"]["inclusive"],
},
countries=config["countries"],
output:

View File

@ -312,14 +312,14 @@ if __name__ == "__main__":
set_line_s_max_pu(n, snakemake.params.lines["s_max_pu"])
# temporal averaging
nhours_config = snakemake.params.snapshots.get("resolution",False)
nhours_config = snakemake.params.snapshots.get("resolution", False)
nhours_wildcard = get_opt(opts, r"^\d+h$")
if nhours_wildcard is not None or isinstance(nhours_config, str):
nhours = nhours_wildcard or nhours_config
n = average_every_nhours(n, nhours)
# segments with package tsam
time_seg_config = snakemake.params.snapshots.get("segmentation",False)
time_seg_config = snakemake.params.snapshots.get("segmentation", False)
time_seg_wildcard = get_opt(opts, r"^\d+seg$")
if time_seg_wildcard is not None or isinstance(time_seg_config, str):
time_seg = time_seg_wildcard or time_seg_config
@ -375,7 +375,9 @@ if __name__ == "__main__":
sel = c.df.carrier.str.contains(carrier)
c.df.loc[sel, attr] *= factor
Ept_config = snakemake.params.costs["emission_prices"].get("co2_monthly_prices", False)
Ept_config = snakemake.params.costs["emission_prices"].get(
"co2_monthly_prices", False
)
for o in opts:
if "Ept" in o or Ept_config:
logger.info(
@ -392,7 +394,9 @@ if __name__ == "__main__":
add_emission_prices(n, dict(co2=co2_wildcard))
else:
logger.info("Setting CO2 prices according to config value.")
add_emission_prices(n, dict(co2=snakemake.params.costs["emission_prices"]["co2"]))
add_emission_prices(
n, dict(co2=snakemake.params.costs["emission_prices"]["co2"])
)
ll_type, factor = snakemake.wildcards.ll[0], snakemake.wildcards.ll[1:]
set_transmission_limit(n, ll_type, factor, costs, Nyears)