diff --git a/config/config.default.yaml b/config/config.default.yaml index 5a588650..1eaf9fa1 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: "" @@ -601,12 +599,14 @@ clustering: to_substations: false algorithm: kmeans # choose from: [hac, kmeans] feature: solar+onwind-time + focus_weights: false exclude_carriers: [] remove_stubs: true remove_stubs_across_borders: true cluster_network: algorithm: kmeans feature: solar+onwind-time + focus_weights: false exclude_carriers: [] consider_efficiency_classes: false aggregation_strategies: diff --git a/doc/configtables/clustering.csv b/doc/configtables/clustering.csv index 5f52c222..a08af37a 100644 --- a/doc/configtables/clustering.csv +++ b/doc/configtables/clustering.csv @@ -3,12 +3,14 @@ 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‘}", -- feature,str,"Str in the format ‘carrier1+carrier2+...+carrierN-X’, where CarrierI can be from {‘solar’, ‘onwind’, ‘offwind’, ‘ror’} and X is one of {‘cap’, ‘time’}.", +-- 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. -- exclude_carriers,list,"List of Str like [ 'solar', 'onwind'] or empy list []","List of carriers which will not be aggregated. If empty, all carriers will be aggregated." -- remove stubs,bool,"{'true','false'}",Controls whether radial parts of the network should be recursively aggregated. Defaults to true. -- remove_stubs_across_borders,bool,"{'true','false'}",Controls whether radial parts of the network should be recursively aggregated across borders. Defaults to true. cluster_network,,, -- algorithm,str,"One of {‘kmeans’, ‘hac’}", -- feature,str,"Str in the format ‘carrier1+carrier2+...+carrierN-X’, where CarrierI can be from {‘solar’, ‘onwind’, ‘offwind’, ‘ror’} and X is one of {‘cap’, ‘time’}.", +-- 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. -- exclude_carriers,list,"List of Str like [ 'solar', 'onwind'] or empy list []","List of carriers which will not be aggregated. If empty, all carriers will be aggregated." -- consider_efficiency_classes,bool,"{'true','false'}","Aggregated each carriers into the top 10-quantile (high), the bottom 90-quantile (low), and everything in between (medium)." aggregation_strategies,,, 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/rules/build_electricity.smk b/rules/build_electricity.smk index cc4f6f5e..6f32b203 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -374,7 +374,7 @@ 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"], @@ -409,7 +409,7 @@ 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 dc4e8c4e..9eadf2ab 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: