Automatic formatting of snakemake rules
This commit is contained in:
parent
3c31caf993
commit
c2e7c125c7
@ -19,6 +19,7 @@ if config["enable"].get("prepare_links_p_nom", False):
|
|||||||
|
|
||||||
|
|
||||||
if config["enable"].get("retrieve_opsd_load_data", True):
|
if config["enable"].get("retrieve_opsd_load_data", True):
|
||||||
|
|
||||||
rule build_electricity_demand:
|
rule build_electricity_demand:
|
||||||
params:
|
params:
|
||||||
snapshots=config_provider("snapshots"),
|
snapshots=config_provider("snapshots"),
|
||||||
@ -390,7 +391,7 @@ rule build_hydro_profile:
|
|||||||
+ ".nc",
|
+ ".nc",
|
||||||
output:
|
output:
|
||||||
profile=resources("profile{weather_year}_hydro.nc"),
|
profile=resources("profile{weather_year}_hydro.nc"),
|
||||||
eia_hydro=resources("eia_hydro_stats{weather_year}.csv")
|
eia_hydro=resources("eia_hydro_stats{weather_year}.csv"),
|
||||||
log:
|
log:
|
||||||
logs("build_hydro_profile{weather_year}.log"),
|
logs("build_hydro_profile{weather_year}.log"),
|
||||||
resources:
|
resources:
|
||||||
@ -427,7 +428,7 @@ rule build_line_rating:
|
|||||||
|
|
||||||
def input_profile_tech(w):
|
def input_profile_tech(w):
|
||||||
return {
|
return {
|
||||||
f"profile_{tech}": resources(f"profile{{weather_year}}_{tech}.nc")
|
f"profile_{tech}": resources(f"profile{weather_year}_{tech}.nc")
|
||||||
for tech in config_provider("electricity", "renewable_carriers")(w)
|
for tech in config_provider("electricity", "renewable_carriers")(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -514,7 +515,9 @@ rule simplify_network:
|
|||||||
output:
|
output:
|
||||||
network=resources("networks/elec{weather_year}_s{simpl}.nc"),
|
network=resources("networks/elec{weather_year}_s{simpl}.nc"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}.geojson"),
|
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}.geojson"),
|
||||||
regions_offshore=resources("regions_offshore_elec{weather_year}_s{simpl}.geojson"),
|
regions_offshore=resources(
|
||||||
|
"regions_offshore_elec{weather_year}_s{simpl}.geojson"
|
||||||
|
),
|
||||||
busmap=resources("busmap_elec{weather_year}_s{simpl}.csv"),
|
busmap=resources("busmap_elec{weather_year}_s{simpl}.csv"),
|
||||||
connection_costs=resources("connection_costs{weather_year}_s{simpl}.csv"),
|
connection_costs=resources("connection_costs{weather_year}_s{simpl}.csv"),
|
||||||
log:
|
log:
|
||||||
@ -548,7 +551,9 @@ rule cluster_network:
|
|||||||
input:
|
input:
|
||||||
network=resources("networks/elec{weather_year}_s{simpl}.nc"),
|
network=resources("networks/elec{weather_year}_s{simpl}.nc"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}.geojson"),
|
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}.geojson"),
|
||||||
regions_offshore=resources("regions_offshore_elec{weather_year}_s{simpl}.geojson"),
|
regions_offshore=resources(
|
||||||
|
"regions_offshore_elec{weather_year}_s{simpl}.geojson"
|
||||||
|
),
|
||||||
busmap=ancient(resources("busmap_elec{weather_year}_s{simpl}.csv")),
|
busmap=ancient(resources("busmap_elec{weather_year}_s{simpl}.csv")),
|
||||||
custom_busmap=lambda w: (
|
custom_busmap=lambda w: (
|
||||||
"data/custom_busmap_elec_s{simpl}_{clusters}.csv"
|
"data/custom_busmap_elec_s{simpl}_{clusters}.csv"
|
||||||
@ -560,8 +565,12 @@ rule cluster_network:
|
|||||||
),
|
),
|
||||||
output:
|
output:
|
||||||
network=resources("networks/elec{weather_year}_s{simpl}_{clusters}.nc"),
|
network=resources("networks/elec{weather_year}_s{simpl}_{clusters}.nc"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
regions_offshore=resources("regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
|
regions_offshore=resources(
|
||||||
|
"regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
busmap=resources("busmap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
busmap=resources("busmap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
linemap=resources("linemap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
linemap=resources("linemap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
log:
|
log:
|
||||||
@ -625,9 +634,15 @@ rule prepare_network:
|
|||||||
output:
|
output:
|
||||||
resources("networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
resources("networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
||||||
log:
|
log:
|
||||||
logs("prepare_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.log"),
|
logs(
|
||||||
|
"prepare_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.log"
|
||||||
|
),
|
||||||
benchmark:
|
benchmark:
|
||||||
(benchmarks("prepare_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}"))
|
(
|
||||||
|
benchmarks(
|
||||||
|
"prepare_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}"
|
||||||
|
)
|
||||||
|
)
|
||||||
threads: 1
|
threads: 1
|
||||||
resources:
|
resources:
|
||||||
mem_mb=4000,
|
mem_mb=4000,
|
||||||
|
@ -33,19 +33,25 @@ rule build_clustered_population_layouts:
|
|||||||
pop_layout_total=resources("pop_layout_total{weather_year}.nc"),
|
pop_layout_total=resources("pop_layout_total{weather_year}.nc"),
|
||||||
pop_layout_urban=resources("pop_layout_urban{weather_year}.nc"),
|
pop_layout_urban=resources("pop_layout_urban{weather_year}.nc"),
|
||||||
pop_layout_rural=resources("pop_layout_rural{weather_year}.nc"),
|
pop_layout_rural=resources("pop_layout_rural{weather_year}.nc"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
cutout=lambda w: "cutouts/"
|
cutout=lambda w: "cutouts/"
|
||||||
+ CDIR
|
+ CDIR
|
||||||
+ config_provider("atlite", "default_cutout")(w)
|
+ config_provider("atlite", "default_cutout")(w)
|
||||||
+ ".nc",
|
+ ".nc",
|
||||||
output:
|
output:
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
log:
|
log:
|
||||||
logs("build_clustered_population_layouts{weather_year}_{simpl}_{clusters}.log"),
|
logs("build_clustered_population_layouts{weather_year}_{simpl}_{clusters}.log"),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=10000,
|
mem_mb=10000,
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("build_clustered_population_layouts/{weather_year}s{simpl}_{clusters}")
|
benchmarks(
|
||||||
|
"build_clustered_population_layouts/{weather_year}s{simpl}_{clusters}"
|
||||||
|
)
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -99,10 +105,16 @@ rule build_gas_input_locations:
|
|||||||
),
|
),
|
||||||
entry="data/gas_network/scigrid-gas/data/IGGIELGN_BorderPoints.geojson",
|
entry="data/gas_network/scigrid-gas/data/IGGIELGN_BorderPoints.geojson",
|
||||||
storage="data/gas_network/scigrid-gas/data/IGGIELGN_Storages.geojson",
|
storage="data/gas_network/scigrid-gas/data/IGGIELGN_Storages.geojson",
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
regions_offshore=resources("regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
|
regions_offshore=resources(
|
||||||
|
"regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
gas_input_nodes=resources("gas_input_locations{weather_year}_s{simpl}_{clusters}.geojson"),
|
gas_input_nodes=resources(
|
||||||
|
"gas_input_locations{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
gas_input_nodes_simplified=resources(
|
gas_input_nodes_simplified=resources(
|
||||||
"gas_input_locations{weather_year}_s{simpl}_{clusters}_simplified.csv"
|
"gas_input_locations{weather_year}_s{simpl}_{clusters}_simplified.csv"
|
||||||
),
|
),
|
||||||
@ -119,10 +131,16 @@ rule build_gas_input_locations:
|
|||||||
rule cluster_gas_network:
|
rule cluster_gas_network:
|
||||||
input:
|
input:
|
||||||
cleaned_gas_network=resources("gas_network.csv"),
|
cleaned_gas_network=resources("gas_network.csv"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
regions_offshore=resources("regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
|
regions_offshore=resources(
|
||||||
|
"regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
clustered_gas_network=resources("gas_network_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_gas_network=resources(
|
||||||
|
"gas_network_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=4000,
|
mem_mb=4000,
|
||||||
log:
|
log:
|
||||||
@ -139,13 +157,19 @@ rule build_daily_heat_demand:
|
|||||||
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
||||||
input:
|
input:
|
||||||
pop_layout=resources("pop_layout_{scope}{weather_year}.nc"),
|
pop_layout=resources("pop_layout_{scope}{weather_year}.nc"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
cutout=lambda w: "cutouts/"
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
|
cutout=(
|
||||||
|
lambda w: "cutouts/"
|
||||||
+ CDIR
|
+ CDIR
|
||||||
+ config_provider("atlite", "default_cutout")(w)
|
+ config_provider("atlite", "default_cutout")(w)
|
||||||
+ ".nc",
|
+ ".nc",
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
heat_demand=resources("daily_heat_demand_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
heat_demand=resources(
|
||||||
|
"daily_heat_demand_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=20000,
|
mem_mb=20000,
|
||||||
threads: 8
|
threads: 8
|
||||||
@ -164,9 +188,13 @@ rule build_hourly_heat_demand:
|
|||||||
snapshots=config_provider("snapshots"),
|
snapshots=config_provider("snapshots"),
|
||||||
input:
|
input:
|
||||||
heat_profile="data/heat_load_profile_BDEW.csv",
|
heat_profile="data/heat_load_profile_BDEW.csv",
|
||||||
heat_demand=resources("daily_heat_demand_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
heat_demand=resources(
|
||||||
|
"daily_heat_demand_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
heat_demand=resources("hourly_heat_demand_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
heat_demand=resources(
|
||||||
|
"hourly_heat_demand_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=2000,
|
mem_mb=2000,
|
||||||
threads: 8
|
threads: 8
|
||||||
@ -186,13 +214,17 @@ rule build_temperature_profiles:
|
|||||||
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
||||||
input:
|
input:
|
||||||
pop_layout=resources("pop_layout_{scope}{weather_year}.nc"),
|
pop_layout=resources("pop_layout_{scope}{weather_year}.nc"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
cutout=lambda w: "cutouts/"
|
cutout=lambda w: "cutouts/"
|
||||||
+ CDIR
|
+ CDIR
|
||||||
+ config_provider("atlite", "default_cutout")(w)
|
+ config_provider("atlite", "default_cutout")(w)
|
||||||
+ ".nc",
|
+ ".nc",
|
||||||
output:
|
output:
|
||||||
temp_soil=resources("temp_soil_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_soil=resources(
|
||||||
|
"temp_soil_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
temp_air=resources("temp_air_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_air=resources("temp_air_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=20000,
|
mem_mb=20000,
|
||||||
@ -200,7 +232,9 @@ rule build_temperature_profiles:
|
|||||||
log:
|
log:
|
||||||
logs("build_temperature_profiles_{scope}_{weather_year}_{simpl}_{clusters}.log"),
|
logs("build_temperature_profiles_{scope}_{weather_year}_{simpl}_{clusters}.log"),
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("build_temperature_profiles/{scope}_{weather_year}_s{simpl}_{clusters}")
|
benchmarks(
|
||||||
|
"build_temperature_profiles/{scope}_{weather_year}_s{simpl}_{clusters}"
|
||||||
|
)
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -211,19 +245,43 @@ rule build_cop_profiles:
|
|||||||
params:
|
params:
|
||||||
heat_pump_sink_T=config_provider("sector", "heat_pump_sink_T"),
|
heat_pump_sink_T=config_provider("sector", "heat_pump_sink_T"),
|
||||||
input:
|
input:
|
||||||
temp_soil_total=resources("temp_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_soil_total=resources(
|
||||||
temp_soil_rural=resources("temp_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"temp_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
temp_soil_urban=resources("temp_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
temp_air_total=resources("temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_soil_rural=resources(
|
||||||
temp_air_rural=resources("temp_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"temp_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
temp_air_urban=resources("temp_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
|
temp_soil_urban=resources(
|
||||||
|
"temp_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
temp_air_total=resources(
|
||||||
|
"temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
temp_air_rural=resources(
|
||||||
|
"temp_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
temp_air_urban=resources(
|
||||||
|
"temp_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
cop_soil_total=resources("cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
cop_soil_total=resources(
|
||||||
cop_soil_rural=resources("cop_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
cop_soil_urban=resources("cop_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
cop_air_total=resources("cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
cop_soil_rural=resources(
|
||||||
cop_air_rural=resources("cop_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"cop_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
cop_air_urban=resources("cop_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
|
cop_soil_urban=resources(
|
||||||
|
"cop_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_total=resources(
|
||||||
|
"cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_rural=resources(
|
||||||
|
"cop_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_urban=resources(
|
||||||
|
"cop_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=20000,
|
mem_mb=20000,
|
||||||
log:
|
log:
|
||||||
@ -243,20 +301,28 @@ rule build_solar_thermal_profiles:
|
|||||||
solar_thermal=config_provider("solar_thermal"),
|
solar_thermal=config_provider("solar_thermal"),
|
||||||
input:
|
input:
|
||||||
pop_layout=resources("pop_layout_{scope}{weather_year}.nc"),
|
pop_layout=resources("pop_layout_{scope}{weather_year}.nc"),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
cutout=lambda w: "cutouts/"
|
cutout=lambda w: "cutouts/"
|
||||||
+ CDIR
|
+ CDIR
|
||||||
+ config_provider("atlite", "default_cutout")(w)
|
+ config_provider("atlite", "default_cutout")(w)
|
||||||
+ ".nc",
|
+ ".nc",
|
||||||
output:
|
output:
|
||||||
solar_thermal=resources("solar_thermal_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
solar_thermal=resources(
|
||||||
|
"solar_thermal_{scope}_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=20000,
|
mem_mb=20000,
|
||||||
threads: 16
|
threads: 16
|
||||||
log:
|
log:
|
||||||
logs("build_solar_thermal_profiles_{scope}_{weather_year}_s{simpl}_{clusters}.log"),
|
logs(
|
||||||
|
"build_solar_thermal_profiles_{scope}_{weather_year}_s{simpl}_{clusters}.log"
|
||||||
|
),
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("build_solar_thermal_profiles/{scope}_{weather_year}_s{simpl}_{clusters}")
|
benchmarks(
|
||||||
|
"build_solar_thermal_profiles/{scope}_{weather_year}_s{simpl}_{clusters}"
|
||||||
|
)
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -304,7 +370,7 @@ rule build_heat_totals:
|
|||||||
log:
|
log:
|
||||||
logs("build_heat_totals.log"),
|
logs("build_heat_totals.log"),
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("build_heat_totals"),
|
benchmarks("build_heat_totals")
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -320,7 +386,9 @@ rule build_biomass_potentials:
|
|||||||
keep_local=True,
|
keep_local=True,
|
||||||
),
|
),
|
||||||
nuts2="data/bundle-sector/nuts/NUTS_RG_10M_2013_4326_LEVL_2.geojson", # https://gisco-services.ec.europa.eu/distribution/v2/nuts/download/#nuts21
|
nuts2="data/bundle-sector/nuts/NUTS_RG_10M_2013_4326_LEVL_2.geojson", # https://gisco-services.ec.europa.eu/distribution/v2/nuts/download/#nuts21
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
nuts3_population=ancient("data/bundle/nama_10r_3popgdp.tsv.gz"),
|
nuts3_population=ancient("data/bundle/nama_10r_3popgdp.tsv.gz"),
|
||||||
swiss_cantons=ancient("data/bundle/ch_cantons.csv"),
|
swiss_cantons=ancient("data/bundle/ch_cantons.csv"),
|
||||||
swiss_population=ancient("data/bundle/je-e-21.03.02.xls"),
|
swiss_population=ancient("data/bundle/je-e-21.03.02.xls"),
|
||||||
@ -336,9 +404,13 @@ rule build_biomass_potentials:
|
|||||||
resources:
|
resources:
|
||||||
mem_mb=1000,
|
mem_mb=1000,
|
||||||
log:
|
log:
|
||||||
logs("build_biomass_potentials{weather_year}_s{simpl}_{clusters}_{planning_horizons}.log"),
|
logs(
|
||||||
|
"build_biomass_potentials{weather_year}_s{simpl}_{clusters}_{planning_horizons}.log"
|
||||||
|
),
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("build_biomass_potentials{weather_year}_s{simpl}_{clusters}_{planning_horizons}")
|
benchmarks(
|
||||||
|
"build_biomass_potentials{weather_year}_s{simpl}_{clusters}_{planning_horizons}"
|
||||||
|
)
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -376,8 +448,12 @@ rule build_sequestration_potentials:
|
|||||||
"https://raw.githubusercontent.com/ericzhou571/Co2Storage/main/resources/complete_map_2020_unit_Mt.geojson",
|
"https://raw.githubusercontent.com/ericzhou571/Co2Storage/main/resources/complete_map_2020_unit_Mt.geojson",
|
||||||
keep_local=True,
|
keep_local=True,
|
||||||
),
|
),
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
regions_offshore=resources("regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
|
regions_offshore=resources(
|
||||||
|
"regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
sequestration_potential=resources(
|
sequestration_potential=resources(
|
||||||
"co2_sequestration_potential_elec{weather_year}_s{simpl}_{clusters}.csv"
|
"co2_sequestration_potential_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
@ -398,10 +474,16 @@ rule build_sequestration_potentials:
|
|||||||
rule build_salt_cavern_potentials:
|
rule build_salt_cavern_potentials:
|
||||||
input:
|
input:
|
||||||
salt_caverns="data/bundle-sector/h2_salt_caverns_GWh_per_sqkm.geojson",
|
salt_caverns="data/bundle-sector/h2_salt_caverns_GWh_per_sqkm.geojson",
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
regions_offshore=resources("regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
|
regions_offshore=resources(
|
||||||
|
"regions_offshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
h2_cavern_potential=resources("salt_cavern_potentials{weather_year}_s{simpl}_{clusters}.csv"),
|
h2_cavern_potential=resources(
|
||||||
|
"salt_cavern_potentials{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
threads: 1
|
threads: 1
|
||||||
resources:
|
resources:
|
||||||
mem_mb=2000,
|
mem_mb=2000,
|
||||||
@ -543,8 +625,12 @@ rule build_industrial_distribution_key:
|
|||||||
),
|
),
|
||||||
countries=config_provider("countries"),
|
countries=config_provider("countries"),
|
||||||
input:
|
input:
|
||||||
regions_onshore=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions_onshore=resources(
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
hotmaps_industrial_database="data/bundle-sector/Industrial_Database.csv",
|
hotmaps_industrial_database="data/bundle-sector/Industrial_Database.csv",
|
||||||
output:
|
output:
|
||||||
industrial_distribution_key=resources(
|
industrial_distribution_key=resources(
|
||||||
@ -556,7 +642,9 @@ rule build_industrial_distribution_key:
|
|||||||
log:
|
log:
|
||||||
logs("build_industrial_distribution_key{weather_year}_s{simpl}_{clusters}.log"),
|
logs("build_industrial_distribution_key{weather_year}_s{simpl}_{clusters}.log"),
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("build_industrial_distribution_key/{weather_year}s{simpl}_{clusters}")
|
benchmarks(
|
||||||
|
"build_industrial_distribution_key/{weather_year}s{simpl}_{clusters}"
|
||||||
|
)
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -670,9 +758,13 @@ rule build_industrial_energy_demand_per_node_today:
|
|||||||
resources:
|
resources:
|
||||||
mem_mb=1000,
|
mem_mb=1000,
|
||||||
log:
|
log:
|
||||||
logs("build_industrial_energy_demand_per_node_today{weather_year}_s{simpl}_{clusters}.log"),
|
logs(
|
||||||
|
"build_industrial_energy_demand_per_node_today{weather_year}_s{simpl}_{clusters}.log"
|
||||||
|
),
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("build_industrial_energy_demand_per_node_today/{weather_year}s{simpl}_{clusters}")
|
benchmarks(
|
||||||
|
"build_industrial_energy_demand_per_node_today/{weather_year}s{simpl}_{clusters}"
|
||||||
|
)
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -686,12 +778,16 @@ rule build_retro_cost:
|
|||||||
input:
|
input:
|
||||||
building_stock="data/retro/data_building_stock.csv",
|
building_stock="data/retro/data_building_stock.csv",
|
||||||
data_tabula="data/bundle-sector/retro/tabula-calculator-calcsetbuilding.csv",
|
data_tabula="data/bundle-sector/retro/tabula-calculator-calcsetbuilding.csv",
|
||||||
air_temperature=resources("temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
air_temperature=resources(
|
||||||
|
"temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
u_values_PL="data/retro/u_values_poland.csv",
|
u_values_PL="data/retro/u_values_poland.csv",
|
||||||
tax_w="data/retro/elec{weather_year}tricity_taxes_eu.csv",
|
tax_w="data/retro/elec{weather_year}tricity_taxes_eu.csv",
|
||||||
construction_index="data/retro/comparative_level_investment.csv",
|
construction_index="data/retro/comparative_level_investment.csv",
|
||||||
floor_area_missing="data/retro/floor_area_missing.csv",
|
floor_area_missing="data/retro/floor_area_missing.csv",
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
cost_germany="data/retro/retro_cost_germany.csv",
|
cost_germany="data/retro/retro_cost_germany.csv",
|
||||||
window_assumptions="data/retro/window_assumptions.csv",
|
window_assumptions="data/retro/window_assumptions.csv",
|
||||||
output:
|
output:
|
||||||
@ -712,14 +808,18 @@ rule build_retro_cost:
|
|||||||
rule build_population_weighted_energy_totals:
|
rule build_population_weighted_energy_totals:
|
||||||
input:
|
input:
|
||||||
energy_totals=resources("{kind}_totals.csv"),
|
energy_totals=resources("{kind}_totals.csv"),
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
resources("pop_weighted_{kind}_totals{weather_year}_s{simpl}_{clusters}.csv"),
|
resources("pop_weighted_{kind}_totals{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
threads: 1
|
threads: 1
|
||||||
resources:
|
resources:
|
||||||
mem_mb=2000,
|
mem_mb=2000,
|
||||||
log:
|
log:
|
||||||
logs("build_population_weighted_{kind}_totals{weather_year}_s{simpl}_{clusters}.log"),
|
logs(
|
||||||
|
"build_population_weighted_{kind}_totals{weather_year}_s{simpl}_{clusters}.log"
|
||||||
|
),
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -730,7 +830,9 @@ rule build_shipping_demand:
|
|||||||
input:
|
input:
|
||||||
ports="data/attributed_ports.json",
|
ports="data/attributed_ports.json",
|
||||||
scope=resources("europe_shape.geojson"),
|
scope=resources("europe_shape.geojson"),
|
||||||
regions=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
demand=resources("energy_totals.csv"),
|
demand=resources("energy_totals.csv"),
|
||||||
params:
|
params:
|
||||||
energy_totals_year=config_provider("energy", "energy_totals_year"),
|
energy_totals_year=config_provider("energy", "energy_totals_year"),
|
||||||
@ -753,16 +855,22 @@ rule build_transport_demand:
|
|||||||
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
||||||
sector=config_provider("sector"),
|
sector=config_provider("sector"),
|
||||||
input:
|
input:
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
pop_weighted_energy_totals=resources(
|
pop_weighted_energy_totals=resources(
|
||||||
"pop_weighted_energy_totals{weather_year}_s{simpl}_{clusters}.csv"
|
"pop_weighted_energy_totals{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
),
|
),
|
||||||
transport_data=resources("transport_data.csv"),
|
transport_data=resources("transport_data.csv"),
|
||||||
traffic_data_KFZ="data/bundle-sector/emobility/KFZ__count",
|
traffic_data_KFZ="data/bundle-sector/emobility/KFZ__count",
|
||||||
traffic_data_Pkw="data/bundle-sector/emobility/Pkw__count",
|
traffic_data_Pkw="data/bundle-sector/emobility/Pkw__count",
|
||||||
temp_air_total=resources("temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_air_total=resources(
|
||||||
|
"temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
transport_demand=resources("transport_demand{weather_year}_s{simpl}_{clusters}.csv"),
|
transport_demand=resources(
|
||||||
|
"transport_demand{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
transport_data=resources("transport_data{weather_year}_s{simpl}_{clusters}.csv"),
|
transport_data=resources("transport_data{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
avail_profile=resources("avail_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
avail_profile=resources("avail_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
dsm_profile=resources("dsm_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
dsm_profile=resources("dsm_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
@ -782,7 +890,9 @@ rule build_district_heat_share:
|
|||||||
sector=config_provider("sector"),
|
sector=config_provider("sector"),
|
||||||
input:
|
input:
|
||||||
district_heat_share=resources("district_heat_share.csv"),
|
district_heat_share=resources("district_heat_share.csv"),
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
district_heat_share=resources(
|
district_heat_share=resources(
|
||||||
"district_heat_share_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
"district_heat_share_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
@ -791,7 +901,9 @@ rule build_district_heat_share:
|
|||||||
resources:
|
resources:
|
||||||
mem_mb=1000,
|
mem_mb=1000,
|
||||||
log:
|
log:
|
||||||
logs("build_district_heat_share{weather_year}_s{simpl}_{clusters}_{planning_horizons}.log"),
|
logs(
|
||||||
|
"build_district_heat_share{weather_year}_s{simpl}_{clusters}_{planning_horizons}.log"
|
||||||
|
),
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -805,7 +917,9 @@ rule build_existing_heating_distribution:
|
|||||||
existing_capacities=config_provider("existing_capacities"),
|
existing_capacities=config_provider("existing_capacities"),
|
||||||
input:
|
input:
|
||||||
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
|
existing_heating="data/existing_infrastructure/existing_heating_raw.csv",
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
clustered_pop_energy_layout=resources(
|
clustered_pop_energy_layout=resources(
|
||||||
"pop_weighted_energy_totals{weather_year}_s{simpl}_{clusters}.csv"
|
"pop_weighted_energy_totals{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
),
|
),
|
||||||
@ -835,7 +949,7 @@ rule build_existing_heating_distribution:
|
|||||||
|
|
||||||
def input_profile_offwind(w):
|
def input_profile_offwind(w):
|
||||||
return {
|
return {
|
||||||
f"profile_{tech}": resources(f"profile{{weather_year}}_{tech}.nc")
|
f"profile_{tech}": resources(f"profile{weather_year}_{tech}.nc")
|
||||||
for tech in ["offwind-ac", "offwind-dc"]
|
for tech in ["offwind-ac", "offwind-dc"]
|
||||||
if (tech in config_provider("electricity", "renewable_carriers")(w))
|
if (tech in config_provider("electricity", "renewable_carriers")(w))
|
||||||
}
|
}
|
||||||
@ -883,13 +997,17 @@ rule prepare_sector_network:
|
|||||||
else []
|
else []
|
||||||
),
|
),
|
||||||
sequestration_potential=lambda w: (
|
sequestration_potential=lambda w: (
|
||||||
resources("co2_sequestration_potential_elec{weather_year}_s{simpl}_{clusters}.csv")
|
resources(
|
||||||
|
"co2_sequestration_potential_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
)
|
||||||
if config_provider(
|
if config_provider(
|
||||||
"sector", "regional_co2_sequestration_potential", "enable"
|
"sector", "regional_co2_sequestration_potential", "enable"
|
||||||
)(w)
|
)(w)
|
||||||
else []
|
else []
|
||||||
),
|
),
|
||||||
network=resources("networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
network=resources(
|
||||||
|
"networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"
|
||||||
|
),
|
||||||
energy_totals_name=resources("energy_totals.csv"),
|
energy_totals_name=resources("energy_totals.csv"),
|
||||||
eurostat=input_eurostat,
|
eurostat=input_eurostat,
|
||||||
pop_weighted_energy_totals=resources(
|
pop_weighted_energy_totals=resources(
|
||||||
@ -898,8 +1016,12 @@ rule prepare_sector_network:
|
|||||||
pop_weighted_heat_totals=resources(
|
pop_weighted_heat_totals=resources(
|
||||||
"pop_weighted_heat_totals{weather_year}_s{simpl}_{clusters}.csv"
|
"pop_weighted_heat_totals{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
),
|
),
|
||||||
shipping_demand=resources("shipping_demand{weather_year}_s{simpl}_{clusters}.csv"),
|
shipping_demand=resources(
|
||||||
transport_demand=resources("transport_demand{weather_year}_s{simpl}_{clusters}.csv"),
|
"shipping_demand{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
|
transport_demand=resources(
|
||||||
|
"transport_demand{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
transport_data=resources("transport_data{weather_year}_s{simpl}_{clusters}.csv"),
|
transport_data=resources("transport_data{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
avail_profile=resources("avail_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
avail_profile=resources("avail_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
dsm_profile=resources("dsm_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
dsm_profile=resources("dsm_profile{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
@ -920,10 +1042,14 @@ rule prepare_sector_network:
|
|||||||
if config_provider("foresight")(w) == "overnight"
|
if config_provider("foresight")(w) == "overnight"
|
||||||
else resources("costs_{planning_horizons}.csv")
|
else resources("costs_{planning_horizons}.csv")
|
||||||
),
|
),
|
||||||
h2_cavern=resources("salt_cavern_potentials{weather_year}_s{simpl}_{clusters}.csv"),
|
h2_cavern=resources(
|
||||||
|
"salt_cavern_potentials{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
busmap_s=resources("busmap_elec{weather_year}_s{simpl}.csv"),
|
busmap_s=resources("busmap_elec{weather_year}_s{simpl}.csv"),
|
||||||
busmap=resources("busmap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
busmap=resources("busmap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
simplified_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}.csv"),
|
simplified_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}.csv"),
|
||||||
industrial_demand=resources(
|
industrial_demand=resources(
|
||||||
"industrial_energy_demand_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
"industrial_energy_demand_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
@ -934,18 +1060,42 @@ rule prepare_sector_network:
|
|||||||
district_heat_share=resources(
|
district_heat_share=resources(
|
||||||
"district_heat_share_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
"district_heat_share_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
),
|
),
|
||||||
temp_soil_total=resources("temp_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_soil_total=resources(
|
||||||
temp_soil_rural=resources("temp_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"temp_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
temp_soil_urban=resources("temp_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
temp_air_total=resources("temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_soil_rural=resources(
|
||||||
temp_air_rural=resources("temp_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"temp_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
temp_air_urban=resources("temp_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
cop_soil_total=resources("cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_soil_urban=resources(
|
||||||
cop_soil_rural=resources("cop_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"temp_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
cop_soil_urban=resources("cop_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
cop_air_total=resources("cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
temp_air_total=resources(
|
||||||
cop_air_rural=resources("cop_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"temp_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
cop_air_urban=resources("cop_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
),
|
||||||
|
temp_air_rural=resources(
|
||||||
|
"temp_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
temp_air_urban=resources(
|
||||||
|
"temp_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_soil_total=resources(
|
||||||
|
"cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_soil_rural=resources(
|
||||||
|
"cop_soil_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_soil_urban=resources(
|
||||||
|
"cop_soil_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_total=resources(
|
||||||
|
"cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_rural=resources(
|
||||||
|
"cop_air_rural_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_urban=resources(
|
||||||
|
"cop_air_urban_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
solar_thermal_total=lambda w: (
|
solar_thermal_total=lambda w: (
|
||||||
resources("solar_thermal_total_elec{weather_year}_s{simpl}_{clusters}.nc")
|
resources("solar_thermal_total_elec{weather_year}_s{simpl}_{clusters}.nc")
|
||||||
if config_provider("sector", "solar_thermal")(w)
|
if config_provider("sector", "solar_thermal")(w)
|
||||||
|
@ -34,7 +34,9 @@ rule extra_components_networks:
|
|||||||
rule prepare_elec_networks:
|
rule prepare_elec_networks:
|
||||||
input:
|
input:
|
||||||
expand(
|
expand(
|
||||||
resources("networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
resources(
|
||||||
|
"networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"
|
||||||
|
),
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"],
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
@ -53,7 +55,8 @@ rule prepare_sector_networks:
|
|||||||
rule solve_elec_networks:
|
rule solve_elec_networks:
|
||||||
input:
|
input:
|
||||||
expand(
|
expand(
|
||||||
RESULTS + "networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
RESULTS
|
||||||
|
+ "networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"],
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
@ -23,7 +23,9 @@ if config["foresight"] != "perfect":
|
|||||||
resources:
|
resources:
|
||||||
mem_mb=4000,
|
mem_mb=4000,
|
||||||
benchmark:
|
benchmark:
|
||||||
benchmarks("plot_power_network_clustered/elec{weather_year}_s{simpl}_{clusters}")
|
benchmarks(
|
||||||
|
"plot_power_network_clustered/elec{weather_year}_s{simpl}_{clusters}"
|
||||||
|
)
|
||||||
conda:
|
conda:
|
||||||
"../envs/environment.yaml"
|
"../envs/environment.yaml"
|
||||||
script:
|
script:
|
||||||
@ -35,7 +37,9 @@ if config["foresight"] != "perfect":
|
|||||||
input:
|
input:
|
||||||
network=RESULTS
|
network=RESULTS
|
||||||
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
regions=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
map=RESULTS
|
map=RESULTS
|
||||||
+ "maps/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
+ "maps/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
||||||
@ -62,7 +66,9 @@ if config["foresight"] != "perfect":
|
|||||||
input:
|
input:
|
||||||
network=RESULTS
|
network=RESULTS
|
||||||
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
regions=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
map=RESULTS
|
map=RESULTS
|
||||||
+ "maps/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf",
|
+ "maps/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-h2_network_{planning_horizons}.pdf",
|
||||||
@ -88,7 +94,9 @@ if config["foresight"] != "perfect":
|
|||||||
input:
|
input:
|
||||||
network=RESULTS
|
network=RESULTS
|
||||||
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
regions=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
map=RESULTS
|
map=RESULTS
|
||||||
+ "maps/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf",
|
+ "maps/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-ch4_network_{planning_horizons}.pdf",
|
||||||
@ -125,7 +133,9 @@ if config["foresight"] == "perfect":
|
|||||||
input:
|
input:
|
||||||
network=RESULTS
|
network=RESULTS
|
||||||
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc",
|
+ "postnetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years.nc",
|
||||||
regions=resources("regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"),
|
regions=resources(
|
||||||
|
"regions_onshore_elec{weather_year}_s{simpl}_{clusters}.geojson"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
unpack(output_map_year),
|
unpack(output_map_year),
|
||||||
threads: 2
|
threads: 2
|
||||||
@ -282,11 +292,12 @@ rule plot_elec_statistics:
|
|||||||
plotting=config_provider("plotting"),
|
plotting=config_provider("plotting"),
|
||||||
barplots=STATISTICS_BARPLOTS,
|
barplots=STATISTICS_BARPLOTS,
|
||||||
input:
|
input:
|
||||||
network=RESULTS + "networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
network=RESULTS
|
||||||
|
+ "networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
||||||
output:
|
output:
|
||||||
**{
|
**{
|
||||||
f"{plot}_bar": RESULTS
|
f"{plot}_bar": RESULTS
|
||||||
+ f"figures/statistics_{plot}_bar_elec{{weather_year}}_s{{simpl}}_{{clusters}}_ec_l{{ll}}_{{opts}}.pdf"
|
+ f"figures/statistics_{plot}_bar_elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.pdf"
|
||||||
for plot in STATISTICS_BARPLOTS
|
for plot in STATISTICS_BARPLOTS
|
||||||
},
|
},
|
||||||
barplots_touch=RESULTS
|
barplots_touch=RESULTS
|
||||||
|
@ -179,7 +179,10 @@ if config["enable"]["retrieve"]:
|
|||||||
script:
|
script:
|
||||||
"../scripts/retrieve_gas_infrastructure_data.py"
|
"../scripts/retrieve_gas_infrastructure_data.py"
|
||||||
|
|
||||||
if config["enable"]["retrieve"] and config["enable"].get("retrieve_opsd_load_data", True):
|
|
||||||
|
if config["enable"]["retrieve"] and config["enable"].get(
|
||||||
|
"retrieve_opsd_load_data", True
|
||||||
|
):
|
||||||
|
|
||||||
rule retrieve_electricity_demand:
|
rule retrieve_electricity_demand:
|
||||||
params:
|
params:
|
||||||
@ -197,15 +200,26 @@ if config["enable"]["retrieve"] and config["enable"].get("retrieve_opsd_load_dat
|
|||||||
"../scripts/retrieve_electricity_demand.py"
|
"../scripts/retrieve_electricity_demand.py"
|
||||||
|
|
||||||
|
|
||||||
if config["enable"]["retrieve"] and config["enable"].get('retrieve_artificial_load_data', False):
|
if config["enable"]["retrieve"] and config["enable"].get(
|
||||||
|
"retrieve_artificial_load_data", False
|
||||||
|
):
|
||||||
|
|
||||||
rule retrieve_artificial_load_data:
|
rule retrieve_artificial_load_data:
|
||||||
input: HTTP.remote("https://zenodo.org/record/7070438/files/demand_hourly.csv", keep_local=True, static=True)
|
input:
|
||||||
output: "data/load_artificial_raw.csv"
|
HTTP.remote(
|
||||||
log: logs("retrieve_artificial_load_data.log")
|
"https://zenodo.org/record/7070438/files/demand_hourly.csv",
|
||||||
resources: mem_mb=5000,
|
keep_local=True,
|
||||||
|
static=True,
|
||||||
|
),
|
||||||
|
output:
|
||||||
|
"data/load_artificial_raw.csv",
|
||||||
|
log:
|
||||||
|
logs("retrieve_artificial_load_data.log"),
|
||||||
|
resources:
|
||||||
|
mem_mb=5000,
|
||||||
retries: 2
|
retries: 2
|
||||||
run: move(input[0], output[0])
|
run:
|
||||||
|
move(input[0], output[0])
|
||||||
|
|
||||||
|
|
||||||
if config["enable"]["retrieve"]:
|
if config["enable"]["retrieve"]:
|
||||||
|
@ -13,7 +13,9 @@ rule solve_network:
|
|||||||
),
|
),
|
||||||
custom_extra_functionality=input_custom_extra_functionality,
|
custom_extra_functionality=input_custom_extra_functionality,
|
||||||
input:
|
input:
|
||||||
network=resources("networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
network=resources(
|
||||||
|
"networks/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"
|
||||||
|
),
|
||||||
config=RESULTS + "config.yaml",
|
config=RESULTS + "config.yaml",
|
||||||
output:
|
output:
|
||||||
network=RESULTS
|
network=RESULTS
|
||||||
@ -26,7 +28,10 @@ rule solve_network:
|
|||||||
python=RESULTS
|
python=RESULTS
|
||||||
+ "logs/solve_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}_python.log",
|
+ "logs/solve_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}_python.log",
|
||||||
benchmark:
|
benchmark:
|
||||||
RESULTS + "benchmarks/solve_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}"
|
(
|
||||||
|
RESULTS
|
||||||
|
+ "benchmarks/solve_network/elec{weather_year}_s{simpl}_{clusters}_ec_l{ll}_{opts}"
|
||||||
|
)
|
||||||
threads: solver_threads
|
threads: solver_threads
|
||||||
resources:
|
resources:
|
||||||
mem_mb=memory,
|
mem_mb=memory,
|
||||||
|
@ -15,14 +15,20 @@ rule add_existing_baseyear:
|
|||||||
powerplants=resources("powerplants.csv"),
|
powerplants=resources("powerplants.csv"),
|
||||||
busmap_s=resources("busmap_elec{weather_year}_s{simpl}.csv"),
|
busmap_s=resources("busmap_elec{weather_year}_s{simpl}.csv"),
|
||||||
busmap=resources("busmap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
busmap=resources("busmap_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
||||||
clustered_pop_layout=resources("pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources(
|
||||||
|
"pop_layout_elec{weather_year}_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
costs=lambda w: resources(
|
costs=lambda w: resources(
|
||||||
"costs_{}.csv".format(
|
"costs_{}.csv".format(
|
||||||
config_provider("scenario", "planning_horizons", 0)(w)
|
config_provider("scenario", "planning_horizons", 0)(w)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
cop_soil_total=resources("cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
cop_soil_total=resources(
|
||||||
cop_air_total=resources("cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_total=resources(
|
||||||
|
"cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
existing_heating_distribution=resources(
|
existing_heating_distribution=resources(
|
||||||
"existing_heating_distribution_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
"existing_heating_distribution_elec{weather_year}_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
),
|
),
|
||||||
@ -79,8 +85,12 @@ rule add_brownfield:
|
|||||||
+ "prenetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "prenetworks/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
network_p=solved_previous_horizon, #solved network at previous time step
|
network_p=solved_previous_horizon, #solved network at previous time step
|
||||||
costs=resources("costs_{planning_horizons}.csv"),
|
costs=resources("costs_{planning_horizons}.csv"),
|
||||||
cop_soil_total=resources("cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
cop_soil_total=resources(
|
||||||
cop_air_total=resources("cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"),
|
"cop_soil_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
cop_air_total=resources(
|
||||||
|
"cop_air_total_elec{weather_year}_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
output:
|
output:
|
||||||
RESULTS
|
RESULTS
|
||||||
+ "prenetworks-brownfield/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "prenetworks-brownfield/elec{weather_year}_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
|
Loading…
Reference in New Issue
Block a user