diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index bfbc1bd2..c52404bf 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -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"], diff --git a/rules/build_sector.smk b/rules/build_sector.smk index 56a6b532..53a19852 100644 --- a/rules/build_sector.smk +++ b/rules/build_sector.smk @@ -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: diff --git a/rules/postprocess.smk b/rules/postprocess.smk index 42f0722e..02ac219a 100644 --- a/rules/postprocess.smk +++ b/rules/postprocess.smk @@ -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, diff --git a/rules/validate.smk b/rules/validate.smk index ece9bebd..1c0fe10a 100644 --- a/rules/validate.smk +++ b/rules/validate.smk @@ -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: diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index f89db024..30ac41bf 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -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)