From 739f2d3281bf87df3ba53058d663d8930a8a4726 Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 16 Aug 2024 12:40:55 +0200 Subject: [PATCH] config: consolidate clustering key snakefile: fix cost retrieval --- Snakefile | 12 +++++++----- scripts/prepare_sector_network.py | 4 ++-- test/config.test_myopic.yaml | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Snakefile b/Snakefile index fd97058d1..fd3e0bad3 100644 --- a/Snakefile +++ b/Snakefile @@ -410,6 +410,10 @@ if config["enable"].get("retrieve_cost_data", True): COSTS, log: "logs/" + RDIR + "retrieve_cost_data.log", + resources: + mem_mb=5000, + run: + move(input[0], output[0]) rule retrieve_cost_data_flexible: input: @@ -1038,9 +1042,7 @@ if not config["custom_data"]["gas_network"]: rule prepare_gas_network: params: gas_config=config["sector"]["gas"], - alternative_clustering=config["clustering_options"][ - "alternative_clustering" - ], + alternative_clustering=config["cluster_options"]["alternative_clustering"], countries_list=config["countries"], layer_id=config["build_shape_options"]["gadm_layer_id"], update=config["build_shape_options"]["update_file"], @@ -1122,7 +1124,7 @@ rule build_ship_profile: rule add_export: params: gadm_level=config["sector"]["gadm_level"], - alternative_clustering=config["clustering_options"]["alternative_clustering"], + alternative_clustering=config["cluster_options"]["alternative_clustering"], store=config["export"]["store"], store_capital_costs=config["export"]["store_capital_costs"], export_profile=config["export"]["export_profile"], @@ -1626,7 +1628,7 @@ rule build_industrial_distribution_key: #default data params: countries=config["countries"], gadm_level=config["sector"]["gadm_level"], - alternative_clustering=config["clustering_options"]["alternative_clustering"], + alternative_clustering=config["cluster_options"]["alternative_clustering"], industry_database=config["custom_data"]["industry_database"], input: regions_onshore="resources/" diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 3875f0659..94baa6e22 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1032,7 +1032,7 @@ def add_aviation(n, cost): airport["country"], gadm_level, snakemake.input.shapes_path, - snakemake.config["clustering_options"]["alternative_clustering"], + snakemake.config["cluster_options"]["alternative_clustering"], ), axis=1, ) @@ -1313,7 +1313,7 @@ def add_shipping(n, costs): port["country"], gadm_level, snakemake.input["shapes_path"], - snakemake.config["clustering_options"]["alternative_clustering"], + snakemake.config["cluster_options"]["alternative_clustering"], ), axis=1, ) diff --git a/test/config.test_myopic.yaml b/test/config.test_myopic.yaml index 923f6cd53..bb5fc096b 100644 --- a/test/config.test_myopic.yaml +++ b/test/config.test_myopic.yaml @@ -1,6 +1,7 @@ # SPDX-FileCopyrightText: PyPSA-Earth and PyPSA-Eur Authors # # SPDX-License-Identifier: AGPL-3.0-or-later + logging_level: INFO tutorial: true @@ -45,7 +46,7 @@ policy_config: path_to_ref: "" # Path to the reference case network for additionality calculation, relevant only if additionality is _true_ and is_reference is _false_ re_country_load: false # Set to "True" to force the RE electricity to be equal to the electricity required for hydrogen export and the country electricity load. "False" excludes the country electricity load from the constraint. -clustering_options: +cluster_options: alternative_clustering: true countries: ['NG', 'BJ']