From 3fa8f91e73ea0644abbefeb96ed6079110c52657 Mon Sep 17 00:00:00 2001 From: martacki Date: Fri, 4 Mar 2022 16:29:47 +0100 Subject: [PATCH 1/4] make_summary followup on snakemake dependencies removal --- scripts/make_summary.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/make_summary.py b/scripts/make_summary.py index 3f8ee728..854e9463 100644 --- a/scripts/make_summary.py +++ b/scripts/make_summary.py @@ -54,7 +54,7 @@ Replacing '/summaries/' with '/plots/' creates nice colored maps of the results. """ import logging -from _helpers import configure_logging, retrieve_snakemake_keys +from _helpers import configure_logging import os import pypsa @@ -430,7 +430,8 @@ if __name__ == "__main__": network_dir = os.path.join('results', 'networks') configure_logging(snakemake) - paths, config, wildcards, logs, out = retrieve_snakemake_keys(snakemake) + config = snakemake.config + wildcards = snakemake.wildcards def expand_from_wildcard(key, config): w = getattr(wildcards, key) @@ -451,6 +452,6 @@ if __name__ == "__main__": for l in ll for opts in expand_from_wildcard("opts", config)} - dfs = make_summaries(networks_dict, paths, config, country=wildcards.country) + dfs = make_summaries(networks_dict, snakemake.input, config, country=wildcards.country) - to_csv(dfs, out[0]) + to_csv(dfs, snakemake.output[0]) From a2b113721502d50b05644d51fbfd04b835e98163 Mon Sep 17 00:00:00 2001 From: martacki Date: Tue, 8 Mar 2022 12:35:00 +0100 Subject: [PATCH 2/4] update README.md --- README.md | 4 ++-- data/entsoegridkit/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f569f2e..ab4d63b3 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,9 @@ The dataset consists of: - A grid model based on a modified [GridKit](https://github.com/bdw/GridKit) extraction of the [ENTSO-E Transmission System - Map](https://www.entsoe.eu/data/map/). The grid model contains 6001 lines + Map](https://www.entsoe.eu/data/map/). The grid model contains 6763 lines (alternating current lines at and above 220kV voltage level and all high - voltage direct current lines) and 3657 substations. + voltage direct current lines) and 3642 substations. - The open power plant database [powerplantmatching](https://github.com/FRESNA/powerplantmatching). - Electrical demand time series from the diff --git a/data/entsoegridkit/README.md b/data/entsoegridkit/README.md index dbf9bb8d..7ee77ada 100644 --- a/data/entsoegridkit/README.md +++ b/data/entsoegridkit/README.md @@ -1,6 +1,6 @@ # Unofficial ENTSO-E dataset processed by GridKit -This dataset was generated based on a map extract from May 25, 2018. +This dataset was generated based on a map extract from March 2022. This is an _unofficial_ extract of the [ENTSO-E interactive map](https://www.entsoe.eu/data/map/) of the European power system (including to a limited extent North From 323fdc651ae7c4bdb0b4b1b0eec772b7e7f2c335 Mon Sep 17 00:00:00 2001 From: Seth <78690362+thesethtruth@users.noreply.github.com> Date: Fri, 11 Mar 2022 15:52:34 +0100 Subject: [PATCH 3/4] update toplevel.csv to include quotation marks in focus_weights fixes #328 --- doc/configtables/toplevel.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/configtables/toplevel.csv b/doc/configtables/toplevel.csv index da8a86a5..b7f39d05 100644 --- a/doc/configtables/toplevel.csv +++ b/doc/configtables/toplevel.csv @@ -6,7 +6,7 @@ logging,,, -- format,--,"","Custom format for log messages. See `LogRecord `_ attributes." summary_dir,--,"e.g. 'results'","Directory into which results are written." countries,--,"Subset of {'AL', 'AT', 'BA', 'BE', 'BG', 'CH', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'ME', 'MK', 'NL', 'NO', 'PL', 'PT', 'RO', 'RS', 'SE', 'SI', 'SK'}","European countries defined by their `Two-letter country codes (ISO 3166-1) `_ which should be included in the energy system model." -focus_weights,--,"Keys should be two-digit country codes (e.g. DE) and values should range between 0 and 1","Ratio of total clusters for particular countries. the remaining weight is distributed according to mean load. An example: ``focus_weights: DE: 0.6 FR: 0.2``." +focus_weights,--,"Keys should be two-digit country codes (e.g. DE) and values should range between 0 and 1","Ratio of total clusters for particular countries. the remaining weight is distributed according to mean load. An example: ``focus_weights: 'DE': 0.6 'FR': 0.2``." enable,,, -- prepare_links_p_nom,bool,"{true, false}","Switch to retrieve current HVDC projects from `Wikipedia `_" -- retrieve_databundle,bool,"{true, false}","Switch to retrieve databundle from zenodo via the rule :mod:`retrieve_databundle` or whether to keep a custom databundle located in the corresponding folder." From 1f788e0d5b1a3cf6328fa0d53c17ce891612e635 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 16 Mar 2022 16:16:15 +0100 Subject: [PATCH 4/4] cluster_network: replace np.sum/np.min by pandas.Series.sum/min --- scripts/cluster_network.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 2c457bef..642db4da 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -263,9 +263,9 @@ def clustering_for_n_clusters(n, n_clusters, custom_busmap=False, aggregate_carr algorithm="kmeans", extended_link_costs=0, focus_weights=None): if potential_mode == 'simple': - p_nom_max_strategy = np.sum + p_nom_max_strategy = pd.Series.sum elif potential_mode == 'conservative': - p_nom_max_strategy = np.min + p_nom_max_strategy = pd.Series.min else: raise AttributeError(f"potential_mode should be one of 'simple' or 'conservative' but is '{potential_mode}'") @@ -281,7 +281,7 @@ def clustering_for_n_clusters(n, n_clusters, custom_busmap=False, aggregate_carr aggregate_generators_carriers=aggregate_carriers, aggregate_one_ports=["Load", "StorageUnit"], line_length_factor=line_length_factor, - generator_strategies={'p_nom_max': p_nom_max_strategy, 'p_nom_min': np.sum}, + generator_strategies={'p_nom_max': p_nom_max_strategy, 'p_nom_min': pd.Series.sum}, scale_link_capital_costs=False) if not n.links.empty: