Skip to content

Hotfix: loads saved by memento - #492

Merged
adriengoeller merged 15 commits into
mainfrom
hotfix/loads-climate-breaking-bug
Jul 9, 2026
Merged

Hotfix: loads saved by memento#492
adriengoeller merged 15 commits into
mainfrom
hotfix/loads-climate-breaking-bug

Conversation

@wangjer

@wangjer wangjer commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

What kind of change does this PR introduce?
Bugfix: set_loads now store loads in memento
Fix a bug where climage + loads will not affect loads

Also fix bug to allow changing the number of loads

wangjer added 4 commits July 8, 2026 17:41
Signed-off-by: WANG Jérémy <jeremy.wang@rte-france.com>
Signed-off-by: WANG Jérémy <jeremy.wang@rte-france.com>
Signed-off-by: WANG Jérémy <jeremy.wang@rte-france.com>
Signed-off-by: WANG Jérémy <jeremy.wang@rte-france.com>
@wangjer
wangjer marked this pull request as ready for review July 8, 2026 16:03
Copilot AI review requested due to automatic review settings July 8, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses load-handling correctness when using the memento/rollback workflow by ensuring memoized state derived from load layout is refreshed, and by making SectionStudy.set_loads() update the intermediate state used for warm-start/rollback scenarios.

Changes:

  • Invalidate cached “merge indices” in the Ducloux balance model during reset() so load-layout-dependent merges are recomputed.
  • After SectionStudy.set_loads(), trigger an intermediate warm-start solve so the stored intermediate memento reflects the updated load layout.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/mechaphlowers/core/models/balance/models/model_ducloux.py Clears memoized merge-index/cache attributes on reset to prevent stale merging after load layout changes.
src/mechaphlowers/api/section_study.py Ensures set_loads() refreshes the intermediate warm-start state (memento) after loads are updated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mechaphlowers/core/models/balance/models/model_ducloux.py
Comment thread src/mechaphlowers/api/section_study.py
adriengoeller and others added 9 commits July 9, 2026 08:44
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: WANG Jérémy <jeremy.wang@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>

@adriengoeller adriengoeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I noticed

Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
Signed-off-by: GOELLER Adrien <adrien.goeller@rte-france.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@adriengoeller
adriengoeller merged commit e18d9f6 into main Jul 9, 2026
7 checks passed
@adriengoeller
adriengoeller deleted the hotfix/loads-climate-breaking-bug branch July 9, 2026 11:20
@adriengoeller adriengoeller linked an issue Jul 10, 2026 that may be closed by this pull request
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.

Going back to initial state change L0

3 participants