diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 537762c03..154231eb4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -90,7 +90,7 @@ jobs: - name: Run snakemake test workflows run: | - make test + make test envs=pinned # TODO: Remove custom env handling - name: Run unit tests run: | diff --git a/Makefile b/Makefile index 9d2f5fea5..e0b104f86 100755 --- a/Makefile +++ b/Makefile @@ -54,11 +54,11 @@ install-pinned-macos: _conda_check # Run default tests test: set -e - snakemake solve_elec_networks --configfile config/test/config.electricity.yaml --rerun-triggers=mtime - snakemake --configfile config/test/config.overnight.yaml --rerun-triggers=mtime - snakemake --configfile config/test/config.myopic.yaml --rerun-triggers=mtime - snakemake make_summary_perfect --configfile config/test/config.perfect.yaml --rerun-triggers=mtime - snakemake --configfile config/test/config.scenarios.yaml --rerun-triggers=mtime -n + snakemake solve_elec_networks --configfile config/test/config.electricity.yaml --rerun-triggers=mtime $(if $(filter pinned,$(envs)),--sdm conda) + snakemake --configfile config/test/config.overnight.yaml --rerun-triggers=mtime $(if $(filter pinned,$(envs)),--sdm conda) + snakemake --configfile config/test/config.myopic.yaml --rerun-triggers=mtime $(if $(filter pinned,$(envs)),--sdm conda) + snakemake make_summary_perfect --configfile config/test/config.perfect.yaml --rerun-triggers=mtime $(if $(filter pinned,$(envs)),--sdm conda) + snakemake --configfile config/test/config.scenarios.yaml --rerun-triggers=mtime -n $(if $(filter pinned,$(envs)),--sdm conda) echo "All tests completed successfully." unit-test: @@ -66,11 +66,11 @@ unit-test: # Cleans all output files from tests clean-tests: - snakemake solve_elec_networks --configfile config/test/config.electricity.yaml --rerun-triggers=mtime --delete-all-output - snakemake --configfile config/test/config.overnight.yaml --rerun-triggers=mtime --delete-all-output - snakemake --configfile config/test/config.myopic.yaml --rerun-triggers=mtime --delete-all-output - snakemake make_summary_perfect --configfile config/test/config.perfect.yaml --rerun-triggers=mtime --delete-all-output - snakemake --configfile config/test/config.scenarios.yaml --rerun-triggers=mtime -n --delete-all-output + snakemake solve_elec_networks --configfile config/test/config.electricity.yaml --rerun-triggers=mtime --delete-all-output $(if $(filter pinned,$(envs)),--sdm conda) + snakemake --configfile config/test/config.overnight.yaml --rerun-triggers=mtime --delete-all-output $(if $(filter pinned,$(envs)),--sdm conda) + snakemake --configfile config/test/config.myopic.yaml --rerun-triggers=mtime --delete-all-output $(if $(filter pinned,$(envs)),--sdm conda) + snakemake make_summary_perfect --configfile config/test/config.perfect.yaml --rerun-triggers=mtime --delete-all-output $(if $(filter pinned,$(envs)),--sdm conda) + snakemake --configfile config/test/config.scenarios.yaml --rerun-triggers=mtime -n --delete-all-output $(if $(filter pinned,$(envs)),--sdm conda) # Removes all created files except for large cutout files (similar to fresh clone) reset: diff --git a/Snakefile b/Snakefile index 79e58c573..f1001e851 100644 --- a/Snakefile +++ b/Snakefile @@ -81,7 +81,7 @@ rule create_scenarios: output: config["run"]["scenarios"]["file"], conda: - "envs/retrieve.yaml" + conda_env_provider() script: "config/create_scenarios.py" @@ -110,7 +110,7 @@ rule dag: pdf=resources("dag.pdf"), png=resources("dag.png"), conda: - "envs/environment.yaml" + conda_env_provider() shell: r""" snakemake --rulegraph all | sed -n "/digraph/,\$p" > {output.dot} diff --git a/envs/retrieve.yaml b/envs/retrieve.yaml deleted file mode 100644 index a3c4828c0..000000000 --- a/envs/retrieve.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors -# -# SPDX-License-Identifier: MIT - -name: pypsa-eur-retrieve -channels: -- conda-forge -- bioconda -dependencies: -- python>=3.8 -- pip -- snakemake-minimal>=8.5 -- pandas>=2.1 -- tqdm -- pip: - - snakemake-storage-plugin-http - - snakemake-executor-plugin-slurm - - snakemake-executor-plugin-cluster-generic diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index db390b9d7..3800bce75 100755 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -23,7 +23,7 @@ rule build_electricity_demand: resources: mem_mb=5000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_electricity_demand.py" @@ -47,7 +47,7 @@ rule build_powerplants: resources: mem_mb=7000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_powerplants.py" @@ -93,7 +93,7 @@ rule base_network: resources: mem_mb=1500, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/base_network.py" @@ -120,7 +120,7 @@ rule build_shapes: resources: mem_mb=1500, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_shapes.py" @@ -144,7 +144,7 @@ if config["enable"].get("build_cutout", False): resources: mem_mb=config["atlite"].get("nprocesses", 4) * 1000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_cutout.py" @@ -165,7 +165,7 @@ rule build_ship_raster: benchmark: benchmarks("build_ship_raster") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_ship_raster.py" @@ -208,7 +208,7 @@ rule determine_availability_matrix_MD_UA: resources: mem_mb=config["atlite"].get("nprocesses", 4) * 5000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/determine_availability_matrix_MD_UA.py" @@ -277,7 +277,7 @@ rule determine_availability_matrix: resources: mem_mb=config["atlite"].get("nprocesses", 4) * 5000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/determine_availability_matrix.py" @@ -307,7 +307,7 @@ rule build_renewable_profiles: wildcard_constraints: technology="(?!hydro).*", # Any technology other than hydro conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_renewable_profiles.py" @@ -325,7 +325,7 @@ rule build_monthly_prices: resources: mem_mb=5000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_monthly_prices.py" @@ -352,7 +352,7 @@ rule build_hydro_profile: resources: mem_mb=5000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_hydro_profile.py" @@ -377,7 +377,7 @@ rule build_line_rating: resources: mem_mb=config["atlite"].get("nprocesses", 4) * 1000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_line_rating.py" @@ -412,7 +412,7 @@ rule build_transmission_projects: mem_mb=4000, threads: 1 conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_transmission_projects.py" @@ -450,7 +450,7 @@ rule add_transmission_projects_and_dlr: resources: mem_mb=4000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/add_transmission_projects_and_dlr.py" @@ -498,7 +498,7 @@ rule build_gdp_pop_non_nuts3: resources: mem_mb=8000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_gdp_pop_non_nuts3.py" @@ -521,7 +521,7 @@ rule build_electricity_demand_base: resources: mem_mb=5000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_electricity_demand_base.py" @@ -547,7 +547,7 @@ rule build_hac_features: resources: mem_mb=10000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_hac_features.py" @@ -577,7 +577,7 @@ rule simplify_network: resources: mem_mb=12000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/simplify_network.py" @@ -632,7 +632,7 @@ rule cluster_network: resources: mem_mb=10000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/cluster_network.py" @@ -704,7 +704,7 @@ rule add_electricity: resources: mem_mb=10000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/add_electricity.py" @@ -740,7 +740,7 @@ rule prepare_network: resources: mem_mb=4000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/prepare_network.py" @@ -785,7 +785,7 @@ if config["electricity"]["base_network"] == "osm-raw": resources: mem_mb=4000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/clean_osm_data.py" @@ -825,6 +825,6 @@ if config["electricity"]["base_network"] == "osm-raw": resources: mem_mb=4000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_osm_network.py" diff --git a/rules/build_sector.smk b/rules/build_sector.smk index 04f5c3e8e..60434d97b 100755 --- a/rules/build_sector.smk +++ b/rules/build_sector.smk @@ -23,7 +23,7 @@ rule build_population_layouts: benchmarks("build_population_layouts") threads: 8 conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_population_layouts.py" @@ -47,7 +47,7 @@ rule build_clustered_population_layouts: benchmark: benchmarks("build_clustered_population_layouts/s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_clustered_population_layouts.py" @@ -71,7 +71,7 @@ rule build_simplified_population_layouts: benchmark: benchmarks("build_simplified_population_layouts/s") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_clustered_population_layouts.py" @@ -86,7 +86,7 @@ rule build_gas_network: log: logs("build_gas_network.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_gas_network.py" @@ -108,7 +108,7 @@ rule build_gas_input_locations: log: logs("build_gas_input_locations_s_{clusters}.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_gas_input_locations.py" @@ -125,7 +125,7 @@ rule cluster_gas_network: log: logs("cluster_gas_network_{clusters}.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/cluster_gas_network.py" @@ -161,7 +161,7 @@ rule build_daily_heat_demand: benchmark: benchmarks("build_daily_heat_demand/total_s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_daily_heat_demand.py" @@ -183,7 +183,7 @@ rule build_hourly_heat_demand: benchmark: benchmarks("build_hourly_heat_demand/total_s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_hourly_heat_demand.py" @@ -207,7 +207,7 @@ rule build_temperature_profiles: benchmark: benchmarks("build_temperature_profiles/total_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_temperature_profiles.py" @@ -279,7 +279,7 @@ rule build_central_heating_temperature_profiles: "build_central_heating_temperature_profiles/s_{clusters}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_central_heating_temperature_profiles/run.py" @@ -301,7 +301,7 @@ rule build_heat_source_potentials: benchmark: benchmarks("build_heat_source_potentials/{heat_source}_s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_heat_source_potentials/run.py" @@ -341,7 +341,7 @@ rule build_cop_profiles: benchmark: benchmarks("build_cop_profiles/s_{clusters}_{planning_horizons}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_cop_profiles/run.py" @@ -374,7 +374,7 @@ rule build_direct_heat_source_utilisation_profiles: "build_direct_heat_source_utilisation_profiles/s_{clusters}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_direct_heat_source_utilisation_profiles.py" @@ -411,7 +411,7 @@ rule build_solar_thermal_profiles: benchmark: benchmarks("build_solar_thermal_profiles/total_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_solar_thermal_profiles.py" @@ -444,7 +444,7 @@ rule build_energy_totals: benchmark: benchmarks("build_energy_totals") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_energy_totals.py" @@ -463,7 +463,7 @@ rule build_heat_totals: benchmark: benchmarks("build_heat_totals") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_heat_totals.py" @@ -495,7 +495,7 @@ rule build_biomass_potentials: benchmark: benchmarks("build_biomass_potentials_s_{clusters}_{planning_horizons}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_biomass_potentials.py" @@ -514,7 +514,7 @@ rule build_biomass_transport_costs: benchmark: benchmarks("build_biomass_transport_costs") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_biomass_transport_costs.py" @@ -540,7 +540,7 @@ rule build_sequestration_potentials: benchmark: benchmarks("build_sequestration_potentials_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_sequestration_potentials.py" @@ -560,7 +560,7 @@ rule build_salt_cavern_potentials: benchmark: benchmarks("build_salt_cavern_potentials_s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_salt_cavern_potentials.py" @@ -578,7 +578,7 @@ rule build_ammonia_production: benchmark: benchmarks("build_ammonia_production") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_ammonia_production.py" @@ -600,7 +600,7 @@ rule build_industry_sector_ratios: benchmark: benchmarks("build_industry_sector_ratios") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industry_sector_ratios.py" @@ -628,7 +628,7 @@ rule build_industry_sector_ratios_intermediate: benchmark: benchmarks("build_industry_sector_ratios_{planning_horizons}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industry_sector_ratios_intermediate.py" @@ -654,7 +654,7 @@ rule build_industrial_production_per_country: benchmark: benchmarks("build_industrial_production_per_country") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industrial_production_per_country.py" @@ -682,7 +682,7 @@ rule build_industrial_production_per_country_tomorrow: ) ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industrial_production_per_country_tomorrow.py" @@ -713,7 +713,7 @@ rule build_industrial_distribution_key: benchmark: benchmarks("build_industrial_distribution_key/s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industrial_distribution_key.py" @@ -742,7 +742,7 @@ rule build_industrial_production_per_node: ) ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industrial_production_per_node.py" @@ -776,7 +776,7 @@ rule build_industrial_energy_demand_per_node: ) ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industrial_energy_demand_per_node.py" @@ -804,7 +804,7 @@ rule build_industrial_energy_demand_per_country_today: benchmark: benchmarks("build_industrial_energy_demand_per_country_today") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industrial_energy_demand_per_country_today.py" @@ -829,7 +829,7 @@ rule build_industrial_energy_demand_per_node_today: benchmark: benchmarks("build_industrial_energy_demand_per_node_today/s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_industrial_energy_demand_per_node_today.py" @@ -859,7 +859,7 @@ rule build_retro_cost: benchmark: benchmarks("build_retro_cost/s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_retro_cost.py" @@ -878,7 +878,7 @@ rule build_population_weighted_energy_totals: log: logs("build_population_weighted_{kind}_totals_{clusters}.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_population_weighted_energy_totals.py" @@ -899,7 +899,7 @@ rule build_shipping_demand: log: logs("build_shipping_demand_s_{clusters}.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_shipping_demand.py" @@ -930,7 +930,7 @@ rule build_transport_demand: log: logs("build_transport_demand_s_{clusters}.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_transport_demand.py" @@ -952,7 +952,7 @@ rule build_district_heat_share: log: logs("build_district_heat_share_{clusters}_{planning_horizons}.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_district_heat_share.py" @@ -987,7 +987,7 @@ rule build_existing_heating_distribution: "build_existing_heating_distribution/base_s_{clusters}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_existing_heating_distribution.py" @@ -1021,7 +1021,7 @@ rule time_aggregation: benchmark: benchmarks("time_aggregation_base_s_{clusters}_elec_l{ll}_{opts}_{sector_opts}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/time_aggregation.py" @@ -1057,7 +1057,7 @@ rule build_egs_potentials: log: logs("build_egs_potentials_{clusters}.log"), conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/build_egs_potentials.py" @@ -1216,6 +1216,6 @@ rule prepare_sector_network: + "benchmarks/prepare_sector_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/prepare_sector_network.py" diff --git a/rules/common.smk b/rules/common.smk index 332103f26..ff79c495f 100644 --- a/rules/common.smk +++ b/rules/common.smk @@ -5,7 +5,10 @@ import copy from functools import partial, lru_cache -import os, sys, glob +import os +import sys +import glob +import platform path = workflow.source_path("../scripts/_helpers.py") sys.path.insert(0, os.path.dirname(path)) @@ -78,6 +81,16 @@ def config_provider(*keys, default=None): return partial(static_getter, keys=keys, default=default) +def conda_env_provider(path_level: str = "."): + os_map = { + "Linux": "linux-pinned.yaml", + "Darwin": "macos-pinned.yaml", + "Windows": "windows-pinned.yaml", + } + filename = os_map.get(platform.system(), "linux-pinned.yaml") + return f"{path_level}/envs/{filename}" + + def solver_threads(w): solver_options = config_provider("solving", "solver_options")(w) option_set = config_provider("solving", "solver", "options")(w) diff --git a/rules/development.smk b/rules/development.smk index 832a5f97b..ad6625790 100644 --- a/rules/development.smk +++ b/rules/development.smk @@ -26,6 +26,6 @@ if config["electricity"]["base_network"] == "osm-raw": resources: mem_mb=1000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/prepare_osm_network_release.py" diff --git a/rules/postprocess.smk b/rules/postprocess.smk index 24a7ac34c..239bb17ce 100644 --- a/rules/postprocess.smk +++ b/rules/postprocess.smk @@ -19,7 +19,7 @@ if config["foresight"] != "perfect": benchmark: benchmarks("plot_power_network_clustered/base_s_{clusters}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/plot_power_network_clustered.py" @@ -45,7 +45,7 @@ if config["foresight"] != "perfect": + "benchmarks/plot_power_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/plot_power_network.py" @@ -72,7 +72,7 @@ if config["foresight"] != "perfect": + "benchmarks/plot_hydrogen_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/plot_hydrogen_network.py" @@ -98,7 +98,7 @@ if config["foresight"] != "perfect": + "benchmarks/plot_gas_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/plot_gas_network.py" @@ -126,7 +126,7 @@ if config["foresight"] == "perfect": resources: mem_mb=10000, conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/plot_power_network_perfect.py" @@ -209,7 +209,7 @@ rule make_summary: log: RESULTS + "logs/make_summary.log", conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/make_summary.py" @@ -240,7 +240,7 @@ rule plot_summary: log: RESULTS + "logs/plot_summary.log", conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/plot_summary.py" diff --git a/rules/retrieve.smk b/rules/retrieve.smk index a2d4a9543..d98ce2b3f 100755 --- a/rules/retrieve.smk +++ b/rules/retrieve.smk @@ -39,7 +39,7 @@ if config["enable"]["retrieve"] and config["enable"].get("retrieve_databundle", mem_mb=1000, retries: 2 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_databundle.py" @@ -50,7 +50,7 @@ if config["enable"]["retrieve"] and config["enable"].get("retrieve_databundle", "logs/retrieve_eurostat_data.log", retries: 2 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_eurostat_data.py" @@ -70,7 +70,7 @@ if config["enable"]["retrieve"] and config["enable"].get("retrieve_databundle", "logs/retrieve_eurostat_household_data.log", retries: 2 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_eurostat_household_data.py" @@ -133,7 +133,7 @@ if config["enable"]["retrieve"] and config["enable"].get("retrieve_cost_data", T mem_mb=1000, retries: 2 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_cost_data.py" @@ -154,7 +154,7 @@ if config["enable"]["retrieve"]: "logs/retrieve_gas_infrastructure_data.log", retries: 2 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_gas_infrastructure_data.py" @@ -172,7 +172,7 @@ if config["enable"]["retrieve"]: mem_mb=5000, retries: 2 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_electricity_demand.py" @@ -531,7 +531,7 @@ if config["enable"]["retrieve"]: mem_mb=5000, retries: 2 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_monthly_fuel_prices.py" @@ -605,7 +605,7 @@ if config["enable"]["retrieve"] and ( "logs/retrieve_osm_data_{country}.log", threads: 1 conda: - "../envs/retrieve.yaml" + conda_env_provider("..") script: "../scripts/retrieve_osm_data.py" diff --git a/rules/solve_electricity.smk b/rules/solve_electricity.smk index 36a2a99ab..cebddde5a 100644 --- a/rules/solve_electricity.smk +++ b/rules/solve_electricity.smk @@ -35,7 +35,7 @@ rule solve_network: shadow: "shallow" conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/solve_network.py" @@ -73,6 +73,6 @@ rule solve_operations_network: shadow: "shallow" conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/solve_operations_network.py" diff --git a/rules/solve_myopic.smk b/rules/solve_myopic.smk index 1da678e61..254568478 100644 --- a/rules/solve_myopic.smk +++ b/rules/solve_myopic.smk @@ -48,7 +48,7 @@ rule add_existing_baseyear: + "benchmarks/add_existing_baseyear/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/add_existing_baseyear.py" @@ -96,7 +96,7 @@ rule add_brownfield: + "benchmarks/add_brownfield/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/add_brownfield.py" @@ -141,6 +141,6 @@ rule solve_sector_network_myopic: + "benchmarks/solve_sector_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/solve_network.py" diff --git a/rules/solve_overnight.smk b/rules/solve_overnight.smk index e8217a5ad..6a31acae7 100644 --- a/rules/solve_overnight.smk +++ b/rules/solve_overnight.smk @@ -39,6 +39,6 @@ rule solve_sector_network: + "benchmarks/solve_sector_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/solve_network.py" diff --git a/rules/solve_perfect.smk b/rules/solve_perfect.smk index 00deb475f..9203cf770 100644 --- a/rules/solve_perfect.smk +++ b/rules/solve_perfect.smk @@ -45,7 +45,7 @@ rule add_existing_baseyear: "add_existing_baseyear/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/add_existing_baseyear.py" @@ -84,7 +84,7 @@ rule prepare_perfect_foresight: benchmark: benchmarks("prepare_perfect_foresight_{clusters}_l{ll}_{opts}_{sector_opts}") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/prepare_perfect_foresight.py" @@ -126,7 +126,7 @@ rule solve_sector_network_perfect: + "benchmarks/solve_sector_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_brownfield_all_years}" ) conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/solve_network.py" @@ -171,6 +171,6 @@ rule make_summary_perfect: benchmark: benchmarks("make_summary_perfect") conda: - "../envs/environment.yaml" + conda_env_provider("..") script: "../scripts/make_summary_perfect.py"