pypsa-eur icon indicating copy to clipboard operation
pypsa-eur copied to clipboard

Clustering: build renewable profiles and add all assets after clustering

Open fneum opened this issue 1 year ago • 10 comments

Closes #1189.

Changes proposed in this Pull Request

  • Moved rules simplify_network and cluster_network before add_electricity and build_renewable_profiles
  • Split rule build_renewable_profiles into two separate rules, determine_availability_matrix for land eligibility analysis and build_renewable_profiles, which now only computes the profiles and total potentials from the pre-computed availability matrix.
  • Removed variables weight and potential from output of build_renewable_profiles as it is no longer needed
  • HAC-clustering is now based on wind speeds and irradiation time series rather than capacity factors
  • Added new rule build_hac_features that aggregates cutout weather data to base regions
  • Removed {simpl} wildcard and all associated code of the m suffix of the {cluster} wildcard. This means that the option to pre-cluster the network in simplify_network was removed. It will be superseded by clustering renewable profiles and potentials within clustered regions by resource classes.
  • The rule build_line_rating now directly attaches the DLR profiles to the pypsa.Network which is then returned as output.
  • The rule add_extra_components was integrated into add_electricity
  • Added new rule build_electricity_demand_base to determine the load distribution of the substations in the base network (which was previously done in add_electricity). This time series is used as weights for kmeans-clustering in cluster_network and is later added to the network in add_electricity in aggregated form.
  • The weights of the kmeans clustering algorithm are now exclusively based on the load distribution. Previously, they also included the distribution of thermal capacity.
  • Since the networks no longer start with the whole electricity system added pre-clustering, the files have been renamed from elec...nc to base...nc.
  • The scripts simplify_network.py and cluster_network.py were simplified to become less nested and profited from the removed need to deal with cost data.
  • New configuration options to calculate connection costs of offshore wind plants.

Updated Workflow Graph

intro-workflow

Testing

To be done.

A first observation is that build_renewable_profiles on clustered regions is much faster!

Without a doubt, this PR is not going to be backward compatible, which is why it should be pulled after a v0.12.0 release.

Next steps

  • Cluster renewable profiles and potentials within clustered regions by resource classes, emulating the previous m option in {clusters} wildcard, but better.
  • Add option to cluster by administrative shapes #263.

Checklist

  • [x] I tested my contribution locally and it seems to work fine.
  • [x] Code and workflow changes are sufficiently documented.
  • [x] Changed dependencies are added to envs/environment.yaml.
  • [x] Changes in configuration options are added in all of config.default.yaml.
  • [x] Changes in configuration options are also documented in doc/configtables/*.csv.
  • [ ] A release note doc/release_notes.rst is added.

fneum avatar Aug 06 '24 18:08 fneum