E52B fix: snapshot selection for operational in multi period optimization by FabianHofmann · Pull Request #1437 · PyPSA/PyPSA · GitHub
[go: up one dir, main page]

Skip to content

fix: snapshot selection for operational in multi period optimization#1437

Merged
lkstrp merged 4 commits intomasterfrom
fix/operataional-limit-multiinvest
Nov 12, 2025
Merged

fix: snapshot selection for operational in multi period optimization#1437
lkstrp merged 4 commits intomasterfrom
fix/operataional-limit-multiinvest

Conversation

@FabianHofmann
Copy link
Contributor
@FabianHofmann FabianHofmann commented Nov 10, 2025

Fix the wrong selection of last snapshot per period in case of investment period selection on operational limit constraint

Changes proposed in this Pull Request

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in docs.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes docs/release-notes.md of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@Irieo
Copy link
Contributor
Irieo commented Nov 11, 2025

@FabianHofmann I made a small problem instance trying to understand/recreate the bug and realised that (i) bug was indeed there and (ii) the fix was incomplete because period weightings had the same problem (mismatch between global and investment period index). So I append the fix and add unit test for that.

Copy link
Contributor
@Irieo Irieo left a comment

Choose a reason for hiding this comment

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

See my comment in PR discussion.

@lkstrp lkstrp enabled auto-merge (squash) November 12, 2025 08:41
@FabianHofmann
Copy link
Contributor Author

@FabianHofmann I made a small problem instance trying to understand/recreate the bug and realised that (i) bug was indeed there and (ii) the fix was incomplete because period weightings had the same problem (mismatch between global and investment period index). So I append the fix and add unit test for that.

awesome! thanks @Irieo !

@lkstrp lkstrp disabled auto-merge November 12, 2025 10:39
@lkstrp lkstrp merged commit 93a800f into master Nov 12, 2025
21 of 22 checks passed
@lkstrp lkstrp deleted the fix/operataional-limit-multiinvest branch November 12, 2025 10:39
a-buntjer pushed a commit to a-buntjer/PyPSA that referenced this pull request Nov 27, 2025
Merged changes from PyPSA v1.0.3 and v1.0.4 including:
- Fix busmap clustering for multilinks (PyPSA#1441)
- Fix handling of inactive storage components (PyPSA#1442)
- Fix masking of nan constraints in kvl (PyPSA#1438)
- Fix snapshot selection for operational in multi period (PyPSA#1437)
- Fix ramping-/rolling horizon logic (PyPSA#1428)
- CI improvements and dependency updates

Resolved conflicts in pypsa/optimization/constraints.py:
- Used upstream's c.active_assets approach (cleaner, already handles MultiIndex)
- Preserved our stochastic Store constraint fix (transpose for dimension alignment)
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.

3 participants

0