Skip to content

Attach sector demand after spatial clustering - #786

Open
danielelerede-oet wants to merge 15 commits into
PyPSA:developfrom
open-energy-transition:defer_sector_demand
Open

Attach sector demand after spatial clustering#786
danielelerede-oet wants to merge 15 commits into
PyPSA:developfrom
open-energy-transition:defer_sector_demand

Conversation

@danielelerede-oet

@danielelerede-oet danielelerede-oet commented Aug 28, 2026

Copy link
Copy Markdown

This PR moves sector demand attachment after spatial clustering, reducing the volume of demand time series processed by simplify_network and cluster_network in sector-coupled workflows (for the full US network, on the same machine, the simplify_network step reduces its runtime from ~5 hours to ~1 hour).

The PR builds on the improve_workflow branch (see #785 ).

The applied changes (limited to the defer_sector_demand branch only):

  • Attach only electricity demand before network simplification and clustering.
  • Store sector demand as compact zonal profiles, original bus allocation factors, growth factors, and unit conversions.
  • Preserve bus mappings through simplification and clustering.
  • Reconstruct sector demand in bounded blocks and aggregate it onto clustered buses, retaining original bus-level rounding.
  • Replace initial electricity loads with sector loads at the start of add_extra_components, before demand response and subsequent processing.
  • Update existing workflow dependencies without introducing an optional mode or configuration flag.

Note that cluster assignments may change: clustering weights now reflect electricity demand rather than all sector demands. Consequently, identical clusters or optimization results are not guaranteed.

Checklist

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant