diff --git a/doc/configtables/load.csv b/doc/configtables/load.csv index 204b79d8..a4de8323 100644 --- a/doc/configtables/load.csv +++ b/doc/configtables/load.csv @@ -1,5 +1,4 @@ ,Unit,Values,Description -url,--,string,"Link to open power system data time series data." power_statistics,bool,"{true, false}",Whether to load the electricity consumption data of the ENTSOE power statistics (only for files from 2019 and before) or from the ENTSOE transparency data (only has load data from 2015 onwards). interpolate_limit,hours,integer,"Maximum gap size (consecutive nans) which interpolated linearly." time_shift_for_large_gaps,string,string,"Periods which are used for copying time-slices in order to fill large gaps of nans. Have to be valid ``pandas`` period strings." diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index ab7b1913..b2b5b3d5 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -409,7 +409,7 @@ rule build_line_rating: def input_profile_tech(w): return { - f"profile_{tech}": resources(f"profile{}_{tech}.nc") + f"profile_{tech}": resources(f"profile_{tech}.nc") for tech in config_provider("electricity", "renewable_carriers")(w) } @@ -496,9 +496,7 @@ rule simplify_network: output: network=resources("networks/elec_s{simpl}.nc"), regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"), - regions_offshore=resources( - "regions_offshore_elec_s{simpl}.geojson" - ), + regions_offshore=resources("regions_offshore_elec_s{simpl}.geojson"), busmap=resources("busmap_elec_s{simpl}.csv"), connection_costs=resources("connection_costs_s{simpl}.csv"), log: @@ -532,9 +530,7 @@ rule cluster_network: input: network=resources("networks/elec_s{simpl}.nc"), regions_onshore=resources("regions_onshore_elec_s{simpl}.geojson"), - regions_offshore=resources( - "regions_offshore_elec_s{simpl}.geojson" - ), + regions_offshore=resources("regions_offshore_elec_s{simpl}.geojson"), busmap=ancient(resources("busmap_elec_s{simpl}.csv")), custom_busmap=lambda w: ( "data/custom_busmap_elec_s{simpl}_{clusters}.csv" @@ -546,12 +542,8 @@ rule cluster_network: ), output: network=resources("networks/elec_s{simpl}_{clusters}.nc"), - regions_onshore=resources( - "regions_onshore_elec_s{simpl}_{clusters}.geojson" - ), - regions_offshore=resources( - "regions_offshore_elec_s{simpl}_{clusters}.geojson" - ), + regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"), + regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"), busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"), linemap=resources("linemap_elec_s{simpl}_{clusters}.csv"), log: @@ -615,15 +607,9 @@ rule prepare_network: output: resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"), log: - logs( - "prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.log" - ), + logs("prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.log"), benchmark: - ( - benchmarks( - "prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}" - ) - ) + (benchmarks("prepare_network/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}")) threads: 1 resources: mem_mb=4000, diff --git a/rules/build_sector.smk b/rules/build_sector.smk index 686bb9a1..eecd0fce 100644 --- a/rules/build_sector.smk +++ b/rules/build_sector.smk @@ -160,9 +160,9 @@ rule build_daily_heat_demand: mem_mb=20000, threads: 8 log: - logs("build_daily_heat_demand_{scope}__{simpl}_{clusters}.loc"), + logs("build_daily_heat_demand_{scope}_{simpl}_{clusters}.loc"), benchmark: - benchmarks("build_daily_heat_demand/{scope}__s{simpl}_{clusters}") + benchmarks("build_daily_heat_demand/{scope}_s{simpl}_{clusters}") conda: "../envs/environment.yaml" script: @@ -206,9 +206,9 @@ rule build_temperature_profiles: mem_mb=20000, threads: 8 log: - logs("build_temperature_profiles_{scope}__{simpl}_{clusters}.log"), + logs("build_temperature_profiles_{scope}_{simpl}_{clusters}.log"), benchmark: - benchmarks("build_temperature_profiles/{scope}__s{simpl}_{clusters}") + benchmarks("build_temperature_profiles/{scope}_s{simpl}_{clusters}") conda: "../envs/environment.yaml" script: @@ -272,9 +272,9 @@ rule build_solar_thermal_profiles: mem_mb=20000, threads: 16 log: - logs("build_solar_thermal_profiles_{scope}__s{simpl}_{clusters}.log"), + logs("build_solar_thermal_profiles_{scope}_s{simpl}_{clusters}.log"), benchmark: - benchmarks("build_solar_thermal_profiles/{scope}__s{simpl}_{clusters}") + benchmarks("build_solar_thermal_profiles/{scope}_s{simpl}_{clusters}") conda: "../envs/environment.yaml" script: @@ -853,7 +853,7 @@ rule build_existing_heating_distribution: def input_profile_offwind(w): return { - f"profile_{tech}": resources(f"profile{}_{tech}.nc") + f"profile_{tech}": resources(f"profile_{tech}.nc") for tech in ["offwind-ac", "offwind-dc"] if (tech in config_provider("electricity", "renewable_carriers")(w)) } diff --git a/rules/postprocess.smk b/rules/postprocess.smk index 2eba1591..ac7bf983 100644 --- a/rules/postprocess.smk +++ b/rules/postprocess.smk @@ -297,7 +297,7 @@ rule plot_elec_statistics: output: **{ f"{plot}_bar": RESULTS - + f"figures/statistics_{plot}_bar_elec{}_s{{simpl}}_{{clusters}}_ec_l{{ll}}_{{opts}}.pdf" + + f"figures/statistics_{plot}_bar_elec_s{{simpl}}_{{clusters}}_ec_l{{ll}}_{{opts}}.pdf" for plot in STATISTICS_BARPLOTS }, barplots_touch=RESULTS diff --git a/scripts/build_district_heat_share.py b/scripts/build_district_heat_share.py index 0adf81ed..3cf88466 100644 --- a/scripts/build_district_heat_share.py +++ b/scripts/build_district_heat_share.py @@ -35,7 +35,6 @@ if __name__ == "__main__": district_heat_share = pd.read_csv(snakemake.input.district_heat_share, index_col=0)[ "district heat share" ] - district_heat_share = district_heat_share.groupby("country").max() # make ct-based share nodal district_heat_share = district_heat_share.reindex(pop_layout.ct).fillna(0) diff --git a/scripts/build_industrial_energy_demand_per_node.py b/scripts/build_industrial_energy_demand_per_node.py index 3987c975..ce72ea7a 100644 --- a/scripts/build_industrial_energy_demand_per_node.py +++ b/scripts/build_industrial_energy_demand_per_node.py @@ -15,7 +15,6 @@ if __name__ == "__main__": snakemake = mock_snakemake( "build_industrial_energy_demand_per_node", - weather_year="", simpl="", clusters=48, planning_horizons=2030, diff --git a/scripts/build_population_weighted_energy_totals.py b/scripts/build_population_weighted_energy_totals.py index e055a4c2..b26f289d 100644 --- a/scripts/build_population_weighted_energy_totals.py +++ b/scripts/build_population_weighted_energy_totals.py @@ -23,7 +23,7 @@ if __name__ == "__main__": config = snakemake.config["energy"] if snakemake.wildcards.kind == "heat": - years = pd.date_range(freq="YE", **snakemake.config["snapshots"]).year + years = pd.date_range(freq="YE", **snakemake.params.snapshots).year assert len(years) == 1, "Currently only works for single year." data_year = years[0] else: diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 47b65359..270774af 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -34,8 +34,8 @@ Inputs - ``resources/regions_onshore_elec_s{simpl}.geojson``: confer :ref:`simplify` - ``resources/regions_offshore_elec_s{simpl}.geojson``: confer :ref:`simplify` -- ``networks/elec_s{simpl}.nc``: confer :ref:`simplify` - ``resources/busmap_elec_s{simpl}.csv``: confer :ref:`simplify` +- ``networks/elec_s{simpl}.nc``: confer :ref:`simplify` - ``data/custom_busmap_elec_s{simpl}_{clusters}.csv``: optional input Outputs @@ -454,11 +454,7 @@ if __name__ == "__main__": if "snakemake" not in globals(): from _helpers import mock_snakemake - snakemake = mock_snakemake( - "cluster_network", - simpl="", - clusters="5", - ) + snakemake = mock_snakemake("cluster_network", simpl="", clusters="5") configure_logging(snakemake) set_scenario_config(snakemake) diff --git a/scripts/make_summary.py b/scripts/make_summary.py index 27ce91d3..b9e1a8af 100644 --- a/scripts/make_summary.py +++ b/scripts/make_summary.py @@ -681,7 +681,7 @@ if __name__ == "__main__": networks_dict = { (cluster, ll, opt + sector_opt, planning_horizon): "results/" + snakemake.params.RDIR - + f"postnetworks/elec_s{simpl}_{cluster}_l{ll}_{opt}_{sector_opt}_{planning_horizon}.nc" + + f"/postnetworks/elec_s{simpl}_{cluster}_l{ll}_{opt}_{sector_opt}_{planning_horizon}.nc" for simpl in snakemake.params.scenario["simpl"] for cluster in snakemake.params.scenario["clusters"] for opt in snakemake.params.scenario["opts"] diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index 4de17704..eac026a4 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -65,7 +65,7 @@ Outputs .. image:: img/regions_offshore_elec_s .png :scale: 33 % -- ``resources/busmap_elec_s{simpl}.h5``: Mapping of buses from ``networks/elec.nc`` to ``networks/elec_s{simpl}.nc``; has keys ['/busmap_s'] +- ``resources/busmap_elec_s{simpl}.csv``: Mapping of buses from ``networks/elec.nc`` to ``networks/elec_s{simpl}.nc``; - ``networks/elec_s{simpl}.nc``: .. image:: img/elec_s.png