From f717ce9d3d691ff35849bbe62d9264f9f0c66426 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 18:26:41 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rules/build_electricity.smk | 62 ++++++++----- rules/build_sector.smk | 171 ++++++++++++++++++++++-------------- 2 files changed, 147 insertions(+), 86 deletions(-) diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index 5e3ec2b6..9be7408d 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -12,7 +12,8 @@ if config["enable"].get("prepare_links_p_nom", False): threads: 1 resources: mem_mb=1500, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/prepare_links_p_nom.py" @@ -26,7 +27,8 @@ rule build_load_data: LOGS + "build_load_data.log", resources: mem_mb=5000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_load_data.py" @@ -42,7 +44,8 @@ rule build_powerplants: threads: 1 resources: mem_mb=5000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_powerplants.py" @@ -69,7 +72,8 @@ rule base_network: threads: 1 resources: mem_mb=1500, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/base_network.py" @@ -93,7 +97,8 @@ rule build_shapes: threads: 1 resources: mem_mb=1500, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_shapes.py" @@ -111,7 +116,8 @@ rule build_bus_regions: threads: 1 resources: mem_mb=1000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_bus_regions.py" @@ -131,7 +137,8 @@ if config["enable"].get("build_cutout", False): threads: ATLITE_NPROCESSES resources: mem_mb=ATLITE_NPROCESSES * 1000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_cutout.py" @@ -148,7 +155,8 @@ if config["enable"].get("build_natura_raster", False): mem_mb=5000, log: LOGS + "build_natura_raster.log", - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_natura_raster.py" @@ -171,7 +179,8 @@ rule build_ship_raster: mem_mb=5000, benchmark: BENCHMARKS + "build_ship_raster" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_ship_raster.py" @@ -185,11 +194,13 @@ rule build_renewable_profiles: if config["renewable"][w.technology]["natura"] else [] ), - gebco=ancient(lambda w: ( - "data/bundle/GEBCO_2014_2D.nc" - if config["renewable"][w.technology].get("max_depth") - else [] - )), + gebco=ancient( + lambda w: ( + "data/bundle/GEBCO_2014_2D.nc" + if config["renewable"][w.technology].get("max_depth") + else [] + ) + ), ship_density=lambda w: ( RESOURCES + "shipdensity_raster.nc" if "ship_threshold" in config["renewable"][w.technology].keys() @@ -217,7 +228,8 @@ rule build_renewable_profiles: mem_mb=ATLITE_NPROCESSES * 5000, wildcard_constraints: technology="(?!hydro).*", # Any technology other than hydro - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_renewable_profiles.py" @@ -233,7 +245,8 @@ rule build_hydro_profile: LOGS + "build_hydro_profile.log", resources: mem_mb=5000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_hydro_profile.py" @@ -267,7 +280,8 @@ rule add_electricity: threads: 1 resources: mem_mb=5000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/add_electricity.py" @@ -291,7 +305,8 @@ rule simplify_network: threads: 1 resources: mem_mb=4000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/simplify_network.py" @@ -321,7 +336,8 @@ rule cluster_network: threads: 1 resources: mem_mb=6000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/cluster_network.py" @@ -339,7 +355,8 @@ rule add_extra_components: threads: 1 resources: mem_mb=3000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/add_extra_components.py" @@ -357,6 +374,7 @@ rule prepare_network: threads: 1 resources: mem_mb=4000, - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: - "../scripts/prepare_network.py" \ No newline at end of file + "../scripts/prepare_network.py" diff --git a/rules/build_sector.smk b/rules/build_sector.smk index 7d4cfdb8..1b724d1a 100644 --- a/rules/build_sector.smk +++ b/rules/build_sector.smk @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: MIT + rule build_population_layouts: input: nuts3_shapes=RESOURCES + "nuts3_shapes.geojson", @@ -12,13 +13,14 @@ rule build_population_layouts: pop_layout_urban=RESOURCES + "pop_layout_urban.nc", pop_layout_rural=RESOURCES + "pop_layout_rural.nc", log: - LOGS + "build_population_layouts.log" + LOGS + "build_population_layouts.log", resources: mem_mb=20000, benchmark: BENCHMARKS + "build_population_layouts" threads: 8 - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_population_layouts.py" @@ -33,12 +35,13 @@ rule build_clustered_population_layouts: output: clustered_pop_layout=RESOURCES + "pop_layout_elec_s{simpl}_{clusters}.csv", log: - LOGS + "build_clustered_population_layouts_{simpl}_{clusters}.log" + LOGS + "build_clustered_population_layouts_{simpl}_{clusters}.log", resources: mem_mb=10000, benchmark: BENCHMARKS + "build_clustered_population_layouts/s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_clustered_population_layouts.py" @@ -55,10 +58,11 @@ rule build_simplified_population_layouts: resources: mem_mb=10000, log: - LOGS + "build_simplified_population_layouts_{simpl}" + LOGS + "build_simplified_population_layouts_{simpl}", benchmark: BENCHMARKS + "build_simplified_population_layouts/s{simpl}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_clustered_population_layouts.py" @@ -73,8 +77,9 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]: resources: mem_mb=4000, log: - LOGS + "build_gas_network.log" - conda: "../envs/environment.yaml" + LOGS + "build_gas_network.log", + conda: + "../envs/environment.yaml" script: "../scripts/build_gas_network.py" @@ -98,12 +103,12 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]: resources: mem_mb=2000, log: - LOGS + "build_gas_input_locations_s{simpl}_{clusters}.log" - conda: "../envs/environment.yaml" + LOGS + "build_gas_input_locations_s{simpl}_{clusters}.log", + conda: + "../envs/environment.yaml" script: "../scripts/build_gas_input_locations.py" - rule cluster_gas_network: input: cleaned_gas_network=RESOURCES + "gas_network.csv", @@ -116,8 +121,9 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]: resources: mem_mb=4000, log: - LOGS + "cluster_gas_network_s{simpl}_{clusters}.log" - conda: "../envs/environment.yaml" + LOGS + "cluster_gas_network_s{simpl}_{clusters}.log", + conda: + "../envs/environment.yaml" script: "../scripts/cluster_gas_network.py" @@ -144,10 +150,11 @@ rule build_heat_demands: mem_mb=20000, threads: 8 log: - LOGS + "build_heat_demands_{scope}_{simpl}_{clusters}.loc" + LOGS + "build_heat_demands_{scope}_{simpl}_{clusters}.loc", benchmark: BENCHMARKS + "build_heat_demands/{scope}_s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_heat_demand.py" @@ -164,10 +171,11 @@ 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}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_temperature_profiles.py" @@ -190,10 +198,11 @@ rule build_cop_profiles: resources: mem_mb=20000, log: - LOGS + "build_cop_profiles_s{simpl}_{clusters}.log" + LOGS + "build_cop_profiles_s{simpl}_{clusters}.log", benchmark: BENCHMARKS + "build_cop_profiles/s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_cop_profiles.py" @@ -209,10 +218,11 @@ 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}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_solar_thermal_profiles.py" @@ -233,10 +243,11 @@ rule build_energy_totals: resources: mem_mb=10000, log: - LOGS + "build_energy_totals.log" + LOGS + "build_energy_totals.log", benchmark: BENCHMARKS + "build_energy_totals" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_energy_totals.py" @@ -261,10 +272,11 @@ rule build_biomass_potentials: resources: mem_mb=1000, log: - LOGS + "build_biomass_potentials_s{simpl}_{clusters}.log" + LOGS + "build_biomass_potentials_s{simpl}_{clusters}.log", benchmark: BENCHMARKS + "build_biomass_potentials_s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_biomass_potentials.py" @@ -283,10 +295,11 @@ if config["sector"]["biomass_transport"]: resources: mem_mb=1000, log: - LOGS + "build_biomass_transport_costs.log" + LOGS + "build_biomass_transport_costs.log", benchmark: BENCHMARKS + "build_biomass_transport_costs" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_biomass_transport_costs.py" @@ -318,10 +331,11 @@ if config["sector"]["regional_co2_sequestration_potential"]["enable"]: resources: mem_mb=4000, log: - LOGS + "build_sequestration_potentials_s{simpl}_{clusters}.log" + LOGS + "build_sequestration_potentials_s{simpl}_{clusters}.log", benchmark: BENCHMARKS + "build_sequestration_potentials_s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_sequestration_potentials.py" @@ -344,10 +358,11 @@ rule build_salt_cavern_potentials: resources: mem_mb=2000, log: - LOGS + "build_salt_cavern_potentials_s{simpl}_{clusters}.log" + LOGS + "build_salt_cavern_potentials_s{simpl}_{clusters}.log", benchmark: BENCHMARKS + "build_salt_cavern_potentials_s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_salt_cavern_potentials.py" @@ -361,10 +376,11 @@ rule build_ammonia_production: resources: mem_mb=1000, log: - LOGS + "build_ammonia_production.log" + LOGS + "build_ammonia_production.log", benchmark: BENCHMARKS + "build_ammonia_production" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_ammonia_production.py" @@ -379,10 +395,11 @@ rule build_industry_sector_ratios: resources: mem_mb=1000, log: - LOGS + "build_industry_sector_ratios.log" + LOGS + "build_industry_sector_ratios.log", benchmark: BENCHMARKS + "build_industry_sector_ratios" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_industry_sector_ratios.py" @@ -399,10 +416,11 @@ rule build_industrial_production_per_country: resources: mem_mb=1000, log: - LOGS + "build_industrial_production_per_country.log" + LOGS + "build_industrial_production_per_country.log", benchmark: BENCHMARKS + "build_industrial_production_per_country" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_industrial_production_per_country.py" @@ -418,10 +436,15 @@ rule build_industrial_production_per_country_tomorrow: resources: mem_mb=1000, log: - LOGS + "build_industrial_production_per_country_tomorrow_{planning_horizons}.log" + LOGS + + "build_industrial_production_per_country_tomorrow_{planning_horizons}.log", benchmark: - BENCHMARKS + "build_industrial_production_per_country_tomorrow_{planning_horizons}" - conda: "../envs/environment.yaml" + ( + BENCHMARKS + + "build_industrial_production_per_country_tomorrow_{planning_horizons}" + ) + conda: + "../envs/environment.yaml" script: "../scripts/build_industrial_production_per_country_tomorrow.py" @@ -438,10 +461,11 @@ rule build_industrial_distribution_key: resources: mem_mb=1000, log: - LOGS + "build_industrial_distribution_key_s{simpl}_{clusters}.log" + LOGS + "build_industrial_distribution_key_s{simpl}_{clusters}.log", benchmark: BENCHMARKS + "build_industrial_distribution_key/s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_industrial_distribution_key.py" @@ -459,10 +483,15 @@ rule build_industrial_production_per_node: resources: mem_mb=1000, log: - LOGS + "build_industrial_production_per_node_s{simpl}_{clusters}_{planning_horizons}.log" + LOGS + + "build_industrial_production_per_node_s{simpl}_{clusters}_{planning_horizons}.log", benchmark: - BENCHMARKS + "build_industrial_production_per_node/s{simpl}_{clusters}_{planning_horizons}" - conda: "../envs/environment.yaml" + ( + BENCHMARKS + + "build_industrial_production_per_node/s{simpl}_{clusters}_{planning_horizons}" + ) + conda: + "../envs/environment.yaml" script: "../scripts/build_industrial_production_per_node.py" @@ -481,10 +510,15 @@ rule build_industrial_energy_demand_per_node: resources: mem_mb=1000, log: - LOGS + "build_industrial_energy_demand_per_node_s{simpl}_{clusters}_{planning_horizons}.log" + LOGS + + "build_industrial_energy_demand_per_node_s{simpl}_{clusters}_{planning_horizons}.log", benchmark: - BENCHMARKS + "build_industrial_energy_demand_per_node/s{simpl}_{clusters}_{planning_horizons}" - conda: "../envs/environment.yaml" + ( + BENCHMARKS + + "build_industrial_energy_demand_per_node/s{simpl}_{clusters}_{planning_horizons}" + ) + conda: + "../envs/environment.yaml" script: "../scripts/build_industrial_energy_demand_per_node.py" @@ -502,10 +536,11 @@ rule build_industrial_energy_demand_per_country_today: resources: mem_mb=1000, log: - LOGS + "build_industrial_energy_demand_per_country_today.log" + LOGS + "build_industrial_energy_demand_per_country_today.log", benchmark: BENCHMARKS + "build_industrial_energy_demand_per_country_today" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_industrial_energy_demand_per_country_today.py" @@ -523,10 +558,11 @@ rule build_industrial_energy_demand_per_node_today: resources: mem_mb=1000, log: - LOGS + "build_industrial_energy_demand_per_node_today_s{simpl}_{clusters}.log" + LOGS + "build_industrial_energy_demand_per_node_today_s{simpl}_{clusters}.log", benchmark: BENCHMARKS + "build_industrial_energy_demand_per_node_today/s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_industrial_energy_demand_per_node_today.py" @@ -551,10 +587,11 @@ if config["sector"]["retrofitting"]["retro_endogen"]: resources: mem_mb=1000, log: - LOGS + "build_retro_cost_s{simpl}_{clusters}.log" + LOGS + "build_retro_cost_s{simpl}_{clusters}.log", benchmark: BENCHMARKS + "build_retro_cost/s{simpl}_{clusters}" - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: "../scripts/build_retro_cost.py" @@ -576,8 +613,9 @@ rule build_population_weighted_energy_totals: resources: mem_mb=2000, log: - LOGS + "build_population_weighted_energy_totals_s{simpl}_{clusters}.log" - conda: "../envs/environment.yaml" + LOGS + "build_population_weighted_energy_totals_s{simpl}_{clusters}.log", + conda: + "../envs/environment.yaml" script: "../scripts/build_population_weighted_energy_totals.py" @@ -594,8 +632,9 @@ rule build_shipping_demand: resources: mem_mb=2000, log: - LOGS + "build_shipping_demand_s{simpl}_{clusters}.log" - conda: "../envs/environment.yaml" + LOGS + "build_shipping_demand_s{simpl}_{clusters}.log", + conda: + "../envs/environment.yaml" script: "../scripts/build_shipping_demand.py" @@ -618,8 +657,9 @@ rule build_transport_demand: resources: mem_mb=2000, log: - LOGS + "build_transport_demand_s{simpl}_{clusters}.log" - conda: "../envs/environment.yaml" + LOGS + "build_transport_demand_s{simpl}_{clusters}.log", + conda: + "../envs/environment.yaml" script: "../scripts/build_transport_demand.py" @@ -693,11 +733,14 @@ rule prepare_sector_network: resources: mem_mb=2000, log: - LOGS + "prepare_sector_network_elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log" + LOGS + + "prepare_sector_network_elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log", benchmark: ( - BENCHMARKS + "prepare_sector_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" + BENCHMARKS + + "prepare_sector_network/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) - conda: "../envs/environment.yaml" + conda: + "../envs/environment.yaml" script: - "../scripts/prepare_sector_network.py" \ No newline at end of file + "../scripts/prepare_sector_network.py"