Skip to content

Commit

Permalink
config: consolidate clustering key
Browse files Browse the repository at this point in the history
snakefile: fix cost retrieval
  • Loading branch information
FabianHofmann committed Aug 16, 2024
1 parent 1480d7a commit 739f2d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
12 changes: 7 additions & 5 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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/"
Expand Down
4 changes: 2 additions & 2 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down
3 changes: 2 additions & 1 deletion test/config.test_myopic.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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']
Expand Down

0 comments on commit 739f2d3

Please sign in to comment.