[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] 2024-03-04 16:55:57 +00:00
parent 1f7d4da3e6
commit 7b584f16bb
5 changed files with 84 additions and 244 deletions

View File

@ -33,25 +33,19 @@ rule build_clustered_population_layouts:
pop_layout_total=resources("pop_layout_total.nc"), pop_layout_total=resources("pop_layout_total.nc"),
pop_layout_urban=resources("pop_layout_urban.nc"), pop_layout_urban=resources("pop_layout_urban.nc"),
pop_layout_rural=resources("pop_layout_rural.nc"), pop_layout_rural=resources("pop_layout_rural.nc"),
regions_onshore=resources( regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_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( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_s{simpl}_{clusters}.csv"
),
log: log:
logs("build_clustered_population_layouts_{simpl}_{clusters}.log"), logs("build_clustered_population_layouts_{simpl}_{clusters}.log"),
resources: resources:
mem_mb=10000, mem_mb=10000,
benchmark: benchmark:
benchmarks( benchmarks("build_clustered_population_layouts/s{simpl}_{clusters}")
"build_clustered_population_layouts/s{simpl}_{clusters}"
)
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -105,16 +99,10 @@ 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=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson" regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"),
),
regions_offshore=resources(
"regions_offshore_elec_s{simpl}_{clusters}.geojson"
),
output: output:
gas_input_nodes=resources( gas_input_nodes=resources("gas_input_locations_s{simpl}_{clusters}.geojson"),
"gas_input_locations_s{simpl}_{clusters}.geojson"
),
gas_input_nodes_simplified=resources( gas_input_nodes_simplified=resources(
"gas_input_locations_s{simpl}_{clusters}_simplified.csv" "gas_input_locations_s{simpl}_{clusters}_simplified.csv"
), ),
@ -131,16 +119,10 @@ 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=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson" regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"),
),
regions_offshore=resources(
"regions_offshore_elec_s{simpl}_{clusters}.geojson"
),
output: output:
clustered_gas_network=resources( clustered_gas_network=resources("gas_network_elec_s{simpl}_{clusters}.csv"),
"gas_network_elec_s{simpl}_{clusters}.csv"
),
resources: resources:
mem_mb=4000, mem_mb=4000,
log: log:
@ -170,14 +152,10 @@ 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}.nc"), pop_layout=resources("pop_layout_{scope}.nc"),
regions_onshore=resources( regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson"
),
cutout=heat_demand_cutout, cutout=heat_demand_cutout,
output: output:
heat_demand=resources( heat_demand=resources("daily_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc"),
"daily_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc"
),
resources: resources:
mem_mb=20000, mem_mb=20000,
threads: 8 threads: 8
@ -197,13 +175,9 @@ rule build_hourly_heat_demand:
drop_leap_day=config_provider("enable", "drop_leap_day"), drop_leap_day=config_provider("enable", "drop_leap_day"),
input: input:
heat_profile="data/heat_load_profile_BDEW.csv", heat_profile="data/heat_load_profile_BDEW.csv",
heat_demand=resources( heat_demand=resources("daily_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc"),
"daily_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc"
),
output: output:
heat_demand=resources( heat_demand=resources("hourly_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc"),
"hourly_heat_demand_{scope}_elec_s{simpl}_{clusters}.nc"
),
resources: resources:
mem_mb=2000, mem_mb=2000,
threads: 8 threads: 8
@ -223,14 +197,10 @@ 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}.nc"), pop_layout=resources("pop_layout_{scope}.nc"),
regions_onshore=resources( regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson"
),
cutout=heat_demand_cutout, cutout=heat_demand_cutout,
output: output:
temp_soil=resources( temp_soil=resources("temp_soil_{scope}_elec_s{simpl}_{clusters}.nc"),
"temp_soil_{scope}_elec_s{simpl}_{clusters}.nc"
),
temp_air=resources("temp_air_{scope}_elec_s{simpl}_{clusters}.nc"), temp_air=resources("temp_air_{scope}_elec_s{simpl}_{clusters}.nc"),
resources: resources:
mem_mb=20000, mem_mb=20000,
@ -238,9 +208,7 @@ rule build_temperature_profiles:
log: log:
logs("build_temperature_profiles_{scope}__{simpl}_{clusters}.log"), logs("build_temperature_profiles_{scope}__{simpl}_{clusters}.log"),
benchmark: benchmark:
benchmarks( benchmarks("build_temperature_profiles/{scope}__s{simpl}_{clusters}")
"build_temperature_profiles/{scope}__s{simpl}_{clusters}"
)
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -251,43 +219,19 @@ 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=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
"temp_soil_total_elec_s{simpl}_{clusters}.nc" temp_soil_rural=resources("temp_soil_rural_elec_s{simpl}_{clusters}.nc"),
), temp_soil_urban=resources("temp_soil_urban_elec_s{simpl}_{clusters}.nc"),
temp_soil_rural=resources( temp_air_total=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
"temp_soil_rural_elec_s{simpl}_{clusters}.nc" temp_air_rural=resources("temp_air_rural_elec_s{simpl}_{clusters}.nc"),
), temp_air_urban=resources("temp_air_urban_elec_s{simpl}_{clusters}.nc"),
temp_soil_urban=resources(
"temp_soil_urban_elec_s{simpl}_{clusters}.nc"
),
temp_air_total=resources(
"temp_air_total_elec_s{simpl}_{clusters}.nc"
),
temp_air_rural=resources(
"temp_air_rural_elec_s{simpl}_{clusters}.nc"
),
temp_air_urban=resources(
"temp_air_urban_elec_s{simpl}_{clusters}.nc"
),
output: output:
cop_soil_total=resources( cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
"cop_soil_total_elec_s{simpl}_{clusters}.nc" cop_soil_rural=resources("cop_soil_rural_elec_s{simpl}_{clusters}.nc"),
), cop_soil_urban=resources("cop_soil_urban_elec_s{simpl}_{clusters}.nc"),
cop_soil_rural=resources( cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
"cop_soil_rural_elec_s{simpl}_{clusters}.nc" cop_air_rural=resources("cop_air_rural_elec_s{simpl}_{clusters}.nc"),
), cop_air_urban=resources("cop_air_urban_elec_s{simpl}_{clusters}.nc"),
cop_soil_urban=resources(
"cop_soil_urban_elec_s{simpl}_{clusters}.nc"
),
cop_air_total=resources(
"cop_air_total_elec_s{simpl}_{clusters}.nc"
),
cop_air_rural=resources(
"cop_air_rural_elec_s{simpl}_{clusters}.nc"
),
cop_air_urban=resources(
"cop_air_urban_elec_s{simpl}_{clusters}.nc"
),
resources: resources:
mem_mb=20000, mem_mb=20000,
log: log:
@ -320,25 +264,17 @@ 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}.nc"), pop_layout=resources("pop_layout_{scope}.nc"),
regions_onshore=resources( regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson"
),
cutout=solar_thermal_cutout, cutout=solar_thermal_cutout,
output: output:
solar_thermal=resources( solar_thermal=resources("solar_thermal_{scope}_elec_s{simpl}_{clusters}.nc"),
"solar_thermal_{scope}_elec_s{simpl}_{clusters}.nc"
),
resources: resources:
mem_mb=20000, mem_mb=20000,
threads: 16 threads: 16
log: log:
logs( logs("build_solar_thermal_profiles_{scope}__s{simpl}_{clusters}.log"),
"build_solar_thermal_profiles_{scope}__s{simpl}_{clusters}.log"
),
benchmark: benchmark:
benchmarks( benchmarks("build_solar_thermal_profiles/{scope}__s{simpl}_{clusters}")
"build_solar_thermal_profiles/{scope}__s{simpl}_{clusters}"
)
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -402,9 +338,7 @@ 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=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_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"),
@ -420,13 +354,9 @@ rule build_biomass_potentials:
resources: resources:
mem_mb=1000, mem_mb=1000,
log: log:
logs( logs("build_biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.log"),
"build_biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.log"
),
benchmark: benchmark:
benchmarks( benchmarks("build_biomass_potentials_s{simpl}_{clusters}_{planning_horizons}")
"build_biomass_potentials_s{simpl}_{clusters}_{planning_horizons}"
)
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -464,12 +394,8 @@ 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=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson" regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"),
),
regions_offshore=resources(
"regions_offshore_elec_s{simpl}_{clusters}.geojson"
),
output: output:
sequestration_potential=resources( sequestration_potential=resources(
"co2_sequestration_potential_elec_s{simpl}_{clusters}.csv" "co2_sequestration_potential_elec_s{simpl}_{clusters}.csv"
@ -490,16 +416,10 @@ 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=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson" regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"),
),
regions_offshore=resources(
"regions_offshore_elec_s{simpl}_{clusters}.geojson"
),
output: output:
h2_cavern_potential=resources( h2_cavern_potential=resources("salt_cavern_potentials_s{simpl}_{clusters}.csv"),
"salt_cavern_potentials_s{simpl}_{clusters}.csv"
),
threads: 1 threads: 1
resources: resources:
mem_mb=2000, mem_mb=2000,
@ -641,12 +561,8 @@ rule build_industrial_distribution_key:
), ),
countries=config_provider("countries"), countries=config_provider("countries"),
input: input:
regions_onshore=resources( regions_onshore=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_s{simpl}_{clusters}.geojson" clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
),
clustered_pop_layout=resources(
"pop_layout_elec_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(
@ -658,9 +574,7 @@ rule build_industrial_distribution_key:
log: log:
logs("build_industrial_distribution_key_s{simpl}_{clusters}.log"), logs("build_industrial_distribution_key_s{simpl}_{clusters}.log"),
benchmark: benchmark:
benchmarks( benchmarks("build_industrial_distribution_key/s{simpl}_{clusters}")
"build_industrial_distribution_key/s{simpl}_{clusters}"
)
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -774,13 +688,9 @@ rule build_industrial_energy_demand_per_node_today:
resources: resources:
mem_mb=1000, mem_mb=1000,
log: log:
logs( logs("build_industrial_energy_demand_per_node_today_s{simpl}_{clusters}.log"),
"build_industrial_energy_demand_per_node_today_s{simpl}_{clusters}.log"
),
benchmark: benchmark:
benchmarks( benchmarks("build_industrial_energy_demand_per_node_today/s{simpl}_{clusters}")
"build_industrial_energy_demand_per_node_today/s{simpl}_{clusters}"
)
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -794,16 +704,12 @@ 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( air_temperature=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
"temp_air_total_elec_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/electricity_taxes_eu.csv", tax_w="data/retro/electricity_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( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_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:
@ -824,18 +730,14 @@ 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( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_s{simpl}_{clusters}.csv"
),
output: output:
resources("pop_weighted_{kind}_totals_s{simpl}_{clusters}.csv"), resources("pop_weighted_{kind}_totals_s{simpl}_{clusters}.csv"),
threads: 1 threads: 1
resources: resources:
mem_mb=2000, mem_mb=2000,
log: log:
logs( logs("build_population_weighted_{kind}_totals_s{simpl}_{clusters}.log"),
"build_population_weighted_{kind}_totals_s{simpl}_{clusters}.log"
),
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -846,9 +748,7 @@ 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=resources("regions_onshore_elec_s{simpl}_{clusters}.geojson"),
"regions_onshore_elec_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"),
@ -871,22 +771,16 @@ 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( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_s{simpl}_{clusters}.csv"
),
pop_weighted_energy_totals=resources( pop_weighted_energy_totals=resources(
"pop_weighted_energy_totals_s{simpl}_{clusters}.csv" "pop_weighted_energy_totals_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=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
"temp_air_total_elec_s{simpl}_{clusters}.nc"
),
output: output:
transport_demand=resources( transport_demand=resources("transport_demand_s{simpl}_{clusters}.csv"),
"transport_demand_s{simpl}_{clusters}.csv"
),
transport_data=resources("transport_data_s{simpl}_{clusters}.csv"), transport_data=resources("transport_data_s{simpl}_{clusters}.csv"),
avail_profile=resources("avail_profile_s{simpl}_{clusters}.csv"), avail_profile=resources("avail_profile_s{simpl}_{clusters}.csv"),
dsm_profile=resources("dsm_profile_s{simpl}_{clusters}.csv"), dsm_profile=resources("dsm_profile_s{simpl}_{clusters}.csv"),
@ -906,9 +800,7 @@ 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( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_s{simpl}_{clusters}.csv"
),
output: output:
district_heat_share=resources( district_heat_share=resources(
"district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv" "district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
@ -917,9 +809,7 @@ rule build_district_heat_share:
resources: resources:
mem_mb=1000, mem_mb=1000,
log: log:
logs( logs("build_district_heat_share_s{simpl}_{clusters}_{planning_horizons}.log"),
"build_district_heat_share_s{simpl}_{clusters}_{planning_horizons}.log"
),
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -933,9 +823,7 @@ 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( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_s{simpl}_{clusters}.csv"
),
clustered_pop_energy_layout=resources( clustered_pop_energy_layout=resources(
"pop_weighted_energy_totals_s{simpl}_{clusters}.csv" "pop_weighted_energy_totals_s{simpl}_{clusters}.csv"
), ),
@ -1013,17 +901,13 @@ rule prepare_sector_network:
else [] else []
), ),
sequestration_potential=lambda w: ( sequestration_potential=lambda w: (
resources( resources("co2_sequestration_potential_elec_s{simpl}_{clusters}.csv")
"co2_sequestration_potential_elec_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( network=resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
"networks/elec_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(
@ -1032,12 +916,8 @@ rule prepare_sector_network:
pop_weighted_heat_totals=resources( pop_weighted_heat_totals=resources(
"pop_weighted_heat_totals_s{simpl}_{clusters}.csv" "pop_weighted_heat_totals_s{simpl}_{clusters}.csv"
), ),
shipping_demand=resources( shipping_demand=resources("shipping_demand_s{simpl}_{clusters}.csv"),
"shipping_demand_s{simpl}_{clusters}.csv" transport_demand=resources("transport_demand_s{simpl}_{clusters}.csv"),
),
transport_demand=resources(
"transport_demand_s{simpl}_{clusters}.csv"
),
transport_data=resources("transport_data_s{simpl}_{clusters}.csv"), transport_data=resources("transport_data_s{simpl}_{clusters}.csv"),
avail_profile=resources("avail_profile_s{simpl}_{clusters}.csv"), avail_profile=resources("avail_profile_s{simpl}_{clusters}.csv"),
dsm_profile=resources("dsm_profile_s{simpl}_{clusters}.csv"), dsm_profile=resources("dsm_profile_s{simpl}_{clusters}.csv"),
@ -1058,14 +938,10 @@ 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( h2_cavern=resources("salt_cavern_potentials_s{simpl}_{clusters}.csv"),
"salt_cavern_potentials_s{simpl}_{clusters}.csv"
),
busmap_s=resources("busmap_elec_s{simpl}.csv"), busmap_s=resources("busmap_elec_s{simpl}.csv"),
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"), busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
clustered_pop_layout=resources( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_s{simpl}_{clusters}.csv"
),
simplified_pop_layout=resources("pop_layout_elec_s{simpl}.csv"), simplified_pop_layout=resources("pop_layout_elec_s{simpl}.csv"),
industrial_demand=resources( industrial_demand=resources(
"industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv" "industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
@ -1076,42 +952,18 @@ rule prepare_sector_network:
district_heat_share=resources( district_heat_share=resources(
"district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv" "district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
), ),
temp_soil_total=resources( temp_soil_total=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
"temp_soil_total_elec_s{simpl}_{clusters}.nc" temp_soil_rural=resources("temp_soil_rural_elec_s{simpl}_{clusters}.nc"),
), temp_soil_urban=resources("temp_soil_urban_elec_s{simpl}_{clusters}.nc"),
temp_soil_rural=resources( temp_air_total=resources("temp_air_total_elec_s{simpl}_{clusters}.nc"),
"temp_soil_rural_elec_s{simpl}_{clusters}.nc" temp_air_rural=resources("temp_air_rural_elec_s{simpl}_{clusters}.nc"),
), temp_air_urban=resources("temp_air_urban_elec_s{simpl}_{clusters}.nc"),
temp_soil_urban=resources( cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
"temp_soil_urban_elec_s{simpl}_{clusters}.nc" cop_soil_rural=resources("cop_soil_rural_elec_s{simpl}_{clusters}.nc"),
), cop_soil_urban=resources("cop_soil_urban_elec_s{simpl}_{clusters}.nc"),
temp_air_total=resources( cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
"temp_air_total_elec_s{simpl}_{clusters}.nc" cop_air_rural=resources("cop_air_rural_elec_s{simpl}_{clusters}.nc"),
), cop_air_urban=resources("cop_air_urban_elec_s{simpl}_{clusters}.nc"),
temp_air_rural=resources(
"temp_air_rural_elec_s{simpl}_{clusters}.nc"
),
temp_air_urban=resources(
"temp_air_urban_elec_s{simpl}_{clusters}.nc"
),
cop_soil_total=resources(
"cop_soil_total_elec_s{simpl}_{clusters}.nc"
),
cop_soil_rural=resources(
"cop_soil_rural_elec_s{simpl}_{clusters}.nc"
),
cop_soil_urban=resources(
"cop_soil_urban_elec_s{simpl}_{clusters}.nc"
),
cop_air_total=resources(
"cop_air_total_elec_s{simpl}_{clusters}.nc"
),
cop_air_rural=resources(
"cop_air_rural_elec_s{simpl}_{clusters}.nc"
),
cop_air_urban=resources(
"cop_air_urban_elec_s{simpl}_{clusters}.nc"
),
solar_thermal_total=lambda w: ( solar_thermal_total=lambda w: (
resources("solar_thermal_total_elec_s{simpl}_{clusters}.nc") resources("solar_thermal_total_elec_s{simpl}_{clusters}.nc")
if config_provider("sector", "solar_thermal")(w) if config_provider("sector", "solar_thermal")(w)

View File

@ -15,20 +15,14 @@ rule add_existing_baseyear:
powerplants=resources("powerplants.csv"), powerplants=resources("powerplants.csv"),
busmap_s=resources("busmap_elec_s{simpl}.csv"), busmap_s=resources("busmap_elec_s{simpl}.csv"),
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"), busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
clustered_pop_layout=resources( clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
"pop_layout_elec_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=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
"cop_soil_total_elec_s{simpl}_{clusters}.nc" cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
),
cop_air_total=resources(
"cop_air_total_elec_s{simpl}_{clusters}.nc"
),
existing_heating_distribution=resources( existing_heating_distribution=resources(
"existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv" "existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
), ),
@ -85,12 +79,8 @@ rule add_brownfield:
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "prenetworks/elec_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=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
"cop_soil_total_elec_s{simpl}_{clusters}.nc" cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
),
cop_air_total=resources(
"cop_air_total_elec_s{simpl}_{clusters}.nc"
),
output: output:
RESULTS RESULTS
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",

View File

@ -228,9 +228,7 @@ if __name__ == "__main__":
if "snakemake" not in globals(): if "snakemake" not in globals():
from _helpers import mock_snakemake from _helpers import mock_snakemake
snakemake = mock_snakemake( snakemake = mock_snakemake("add_extra_components", simpl="", clusters=5)
"add_extra_components", simpl="", clusters=5
)
configure_logging(snakemake) configure_logging(snakemake)
set_scenario_config(snakemake) set_scenario_config(snakemake)

View File

@ -200,9 +200,7 @@ if __name__ == "__main__":
if "snakemake" not in globals(): if "snakemake" not in globals():
from _helpers import mock_snakemake from _helpers import mock_snakemake
snakemake = mock_snakemake( snakemake = mock_snakemake("build_renewable_profiles", technology="offwind-dc")
"build_renewable_profiles", technology="offwind-dc"
)
configure_logging(snakemake) configure_logging(snakemake)
set_scenario_config(snakemake) set_scenario_config(snakemake)

View File

@ -455,7 +455,9 @@ if __name__ == "__main__":
from _helpers import mock_snakemake from _helpers import mock_snakemake
snakemake = mock_snakemake( snakemake = mock_snakemake(
"cluster_network", simpl="", clusters="5", "cluster_network",
simpl="",
clusters="5",
) )
configure_logging(snakemake) configure_logging(snakemake)
set_scenario_config(snakemake) set_scenario_config(snakemake)