diff --git a/config/config.default.yaml b/config/config.default.yaml index 8014ed09..a6df173b 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -18,8 +18,6 @@ remote: ssh: "" path: "" -focus_weights: false - # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run run: name: "" @@ -600,6 +598,7 @@ costs: # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#clustering clustering: + focus_weights: false simplify_network: to_substations: false algorithm: kmeans # choose from: [hac, kmeans] diff --git a/doc/configtables/clustering.csv b/doc/configtables/clustering.csv index 5f52c222..e831ca84 100644 --- a/doc/configtables/clustering.csv +++ b/doc/configtables/clustering.csv @@ -1,4 +1,5 @@ ,Unit,Values,Description +focus_weights,,,Optionally specify the focus weights for the clustering of countries. For instance: `DE: 0.8` will distribute 80% of all nodes to Germany and 20% to the rest of the countries. simplify_network,,, -- to_substations,bool,"{'true','false'}","Aggregates all nodes without power injection (positive or negative, i.e. demand or generation) to electrically closest ones" -- algorithm,str,"One of {‘kmeans’, ‘hac’, ‘modularity‘}", diff --git a/doc/configtables/toplevel.csv b/doc/configtables/toplevel.csv index a27623bd..67954389 100644 --- a/doc/configtables/toplevel.csv +++ b/doc/configtables/toplevel.csv @@ -10,4 +10,3 @@ private,,, remote,,, -- ssh,--,,Optionally specify the SSH of a remote cluster to be synchronized. -- path,--,,Optionally specify the file path within the remote cluster to be synchronized. -focus_weights,,,Optionally specify the focus weights for the clustering of countries. For instance: `DE: 0.8` will distribute 80% of all nodes to Germany and 20% to the rest of the countries. diff --git a/doc/release_notes.rst b/doc/release_notes.rst index bdab6fae..ee5a954b 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -33,6 +33,10 @@ Upcoming Release * Split configuration to enable SMR and SMR CC. +* The configuration setting for country focus weights when clustering the + network has been moved from ``focus_weights:`` to ``clustering: + focus_weights:``. Backwards compatibility to old config files is maintained. + * The ``mock_snakemake`` function can now be used with a Snakefile from a different directory using the new ``root_dir`` argument. * Merged option to extend geographical scope to Ukraine and Moldova. These diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index cbbaedab..873e7c3a 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -427,7 +427,9 @@ rule simplify_network: params: simplify_network=config["clustering"]["simplify_network"], aggregation_strategies=config["clustering"].get("aggregation_strategies", {}), - focus_weights=config.get("focus_weights", None), + focus_weights=config["clustering"].get( + "focus_weights", config.get("focus_weights") + ), renewable_carriers=config["electricity"]["renewable_carriers"], max_hours=config["electricity"]["max_hours"], length_factor=config["lines"]["length_factor"], @@ -462,7 +464,9 @@ rule cluster_network: cluster_network=config["clustering"]["cluster_network"], aggregation_strategies=config["clustering"].get("aggregation_strategies", {}), custom_busmap=config["enable"].get("custom_busmap", False), - focus_weights=config.get("focus_weights", None), + focus_weights=config["clustering"].get( + "focus_weights", config.get("focus_weights") + ), renewable_carriers=config["electricity"]["renewable_carriers"], conventional_carriers=config["electricity"].get("conventional_carriers", []), max_hours=config["electricity"]["max_hours"], diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index df72e633..0936db79 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -16,8 +16,7 @@ Relevant Settings clustering: cluster_network: aggregation_strategies: - - focus_weights: + focus_weights: solving: solver: