Skip to content

cutout: improve layout calculation from capacity list#483

Merged
FabianHofmann merged 4 commits intoPyPSA:masterfrom
maurerle:fix_capacity_list
Mar 13, 2026
Merged

cutout: improve layout calculation from capacity list#483
FabianHofmann merged 4 commits intoPyPSA:masterfrom
maurerle:fix_capacity_list

Conversation

@maurerle
Copy link
Copy Markdown
Contributor

@maurerle maurerle commented Mar 7, 2026

Closes #479

Changes proposed in this Pull Request

fixes a performance issue where xarray searches all combinations instead of using monotony of x and y values.

Instead of trying all x/y pairs for all 1126727 in a row - which consumes more than 512GB RAM and fails after an hour - the small numpy solution solves this in 0.1s.

I verified this for different datasets and capacities.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • Newly introduced dependencies are added to environment.yaml, environment_docs.yaml and setup.py (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@maurerle maurerle force-pushed the fix_capacity_list branch from 5bd0b23 to 7c71682 Compare March 7, 2026 01:05
Copy link
Copy Markdown
Contributor

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful, could you add a short release note?

@maurerle maurerle force-pushed the fix_capacity_list branch 2 times, most recently from 0bcdbeb to 1b43c6b Compare March 11, 2026 17:57
@maurerle
Copy link
Copy Markdown
Contributor Author

Sure - should be ready.
The pre-commit.ci is fixed in #484

@maurerle maurerle force-pushed the fix_capacity_list branch from 1b43c6b to b4d66c4 Compare March 12, 2026 08:46
fixes a performance issue where xarray searches all combinations
instead of using monotony of x and y values
@maurerle maurerle force-pushed the fix_capacity_list branch from fa4a689 to 6ead01a Compare March 13, 2026 08:40
@FabianHofmann FabianHofmann merged commit f288580 into PyPSA:master Mar 13, 2026
18 of 19 checks passed
@maurerle maurerle deleted the fix_capacity_list branch March 13, 2026 11:04
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.

historic-comparison-germany hardware requirements

2 participants