diff --git a/doc/release_notes.rst b/doc/release_notes.rst index a1b54396..a378d5b3 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -19,6 +19,7 @@ Upcoming Release * Fix: Value for ``co2base`` in ``config.yaml`` adjusted to 1.487e9 t CO2-eq (from 3.1e9 t CO2-eq). The new value represents emissions related to the electricity sector for EU+UK. The old value was ~2x too high and used when the emissions wildcard in ``{opts}`` was used. * Add option to include marginal costs of links representing fuel cells, electrolysis, and battery inverters [`#232 `_]. +* The ``focus_weights`` are now also considered when pre-clustering in the :mod:`simplify_network` rule [`#241 `_]. PyPSA-Eur 0.3.0 (7th December 2020) ================================== diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index b05d59aa..530204ef 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -324,6 +324,8 @@ def remove_stubs(n): def cluster(n, n_clusters): logger.info(f"Clustering to {n_clusters} buses") + focus_weights = snakemake.config.get('focus_weights', None) + renewable_carriers = pd.Index([tech for tech in n.generators.carrier.unique() if tech.split('-', 2)[0] in snakemake.config['renewable']]) @@ -337,7 +339,8 @@ def cluster(n, n_clusters): for tech in renewable_carriers])) if len(renewable_carriers) > 0 else 'conservative') clustering = clustering_for_n_clusters(n, n_clusters, custom_busmap=False, potential_mode=potential_mode, - solver_name=snakemake.config['solving']['solver']['name']) + solver_name=snakemake.config['solving']['solver']['name'], + focus_weights=focus_weights) return clustering.network, clustering.busmap