Adding focus_weights to pre-clustering (#241)
* Add focus_weights to pre-clustering Hey guys, another quick fix since I noticed it wasn't implemented yet: When pre-clustering the network, the focus_weights have not yet been considered. This may distort clustering results when pre-clustering to a low resolution. * Update release_notes.rst
This commit is contained in:
parent
cf55f00656
commit
11c29ac6cc
@ -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 <https://github.com/PyPSA/pypsa-eur/pull/232>`_].
|
||||
* The ``focus_weights`` are now also considered when pre-clustering in the :mod:`simplify_network` rule [`#241 <https://github.com/PyPSA/pypsa-eur/pull/241>`_].
|
||||
|
||||
PyPSA-Eur 0.3.0 (7th December 2020)
|
||||
==================================
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user