Merge branch 'master' into introduce_hac_clustering
This commit is contained in:
commit
69c0341145
@ -50,9 +50,9 @@ The dataset consists of:
|
|||||||
|
|
||||||
- A grid model based on a modified [GridKit](https://github.com/bdw/GridKit)
|
- A grid model based on a modified [GridKit](https://github.com/bdw/GridKit)
|
||||||
extraction of the [ENTSO-E Transmission System
|
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
|
(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
|
- The open power plant database
|
||||||
[powerplantmatching](https://github.com/FRESNA/powerplantmatching).
|
[powerplantmatching](https://github.com/FRESNA/powerplantmatching).
|
||||||
- Electrical demand time series from the
|
- Electrical demand time series from the
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Unofficial ENTSO-E dataset processed by GridKit
|
# 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
|
This is an _unofficial_ extract of the
|
||||||
[ENTSO-E interactive map](https://www.entsoe.eu/data/map/)
|
[ENTSO-E interactive map](https://www.entsoe.eu/data/map/)
|
||||||
of the European power system (including to a limited extent North
|
of the European power system (including to a limited extent North
|
||||||
|
@ -6,7 +6,7 @@ logging,,,
|
|||||||
-- format,--,"","Custom format for log messages. See `LogRecord <https://docs.python.org/3/library/logging.html#logging.LogRecord>`_ attributes."
|
-- format,--,"","Custom format for log messages. See `LogRecord <https://docs.python.org/3/library/logging.html#logging.LogRecord>`_ attributes."
|
||||||
summary_dir,--,"e.g. 'results'","Directory into which results are written."
|
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) <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`_ which should be included in the energy system model."
|
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) <https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>`_ 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,,,
|
enable,,,
|
||||||
-- prepare_links_p_nom,bool,"{true, false}","Switch to retrieve current HVDC projects from `Wikipedia <https://en.wikipedia.org/wiki/List_of_HVDC_projects>`_"
|
-- prepare_links_p_nom,bool,"{true, false}","Switch to retrieve current HVDC projects from `Wikipedia <https://en.wikipedia.org/wiki/List_of_HVDC_projects>`_"
|
||||||
-- 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."
|
-- 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."
|
||||||
|
|
@ -343,9 +343,9 @@ def clustering_for_n_clusters(n, n_clusters, custom_busmap=False, aggregate_carr
|
|||||||
logger.info(f"Clustering network using algorithm `{algorithm}` and feature `{feature}`...")
|
logger.info(f"Clustering network using algorithm `{algorithm}` and feature `{feature}`...")
|
||||||
|
|
||||||
if potential_mode == 'simple':
|
if potential_mode == 'simple':
|
||||||
p_nom_max_strategy = np.sum
|
p_nom_max_strategy = pd.Series.sum
|
||||||
elif potential_mode == 'conservative':
|
elif potential_mode == 'conservative':
|
||||||
p_nom_max_strategy = np.min
|
p_nom_max_strategy = pd.Series.min
|
||||||
else:
|
else:
|
||||||
raise AttributeError(f"potential_mode should be one of 'simple' or 'conservative' but is '{potential_mode}'")
|
raise AttributeError(f"potential_mode should be one of 'simple' or 'conservative' but is '{potential_mode}'")
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ def clustering_for_n_clusters(n, n_clusters, custom_busmap=False, aggregate_carr
|
|||||||
aggregate_generators_carriers=aggregate_carriers,
|
aggregate_generators_carriers=aggregate_carriers,
|
||||||
aggregate_one_ports=["Load", "StorageUnit"],
|
aggregate_one_ports=["Load", "StorageUnit"],
|
||||||
line_length_factor=line_length_factor,
|
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)
|
scale_link_capital_costs=False)
|
||||||
|
|
||||||
if not n.links.empty:
|
if not n.links.empty:
|
||||||
|
@ -54,7 +54,7 @@ Replacing '/summaries/' with '/plots/' creates nice colored maps of the results.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from _helpers import configure_logging, retrieve_snakemake_keys
|
from _helpers import configure_logging
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pypsa
|
import pypsa
|
||||||
@ -430,7 +430,8 @@ if __name__ == "__main__":
|
|||||||
network_dir = os.path.join('results', 'networks')
|
network_dir = os.path.join('results', 'networks')
|
||||||
configure_logging(snakemake)
|
configure_logging(snakemake)
|
||||||
|
|
||||||
paths, config, wildcards, logs, out = retrieve_snakemake_keys(snakemake)
|
config = snakemake.config
|
||||||
|
wildcards = snakemake.wildcards
|
||||||
|
|
||||||
def expand_from_wildcard(key, config):
|
def expand_from_wildcard(key, config):
|
||||||
w = getattr(wildcards, key)
|
w = getattr(wildcards, key)
|
||||||
@ -451,6 +452,6 @@ if __name__ == "__main__":
|
|||||||
for l in ll
|
for l in ll
|
||||||
for opts in expand_from_wildcard("opts", config)}
|
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])
|
||||||
|
Loading…
Reference in New Issue
Block a user