fix: Silent network optimization failure - #2256
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a silent failure mode in scripts/solve_network.py by ensuring solver warnings are detected correctly (using solver status, not termination condition) and reported as hard errors, preventing export of unsolved networks.
Changes:
- Use
linopy.constants(SolverStatus,TerminationCondition) for clearer, more explicit status/termination checks. - Check infeasibility conditions before handling warning status (since infeasibility may also come with warning status).
- Add a release note entry documenting the new error behavior for warning status.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/solve_network.py | Updates solver result validation logic to raise on warning status and to detect infeasibility via explicit termination-condition constants. |
| doc/release_notes.md | Documents the behavioral change (raise error when solver status is warning). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkroening
marked this pull request as ready for review
August 4, 2026 20:33
Contributor
Author
|
I want to add that this PR was created without AI. This is my first PR and I was not aware that Copilot reviews by default. I have now opted out. :) |
fneum
approved these changes
Aug 11, 2026
fneum
left a comment
Member
There was a problem hiding this comment.
Excellent! Thank you very much!
fneum
enabled auto-merge (squash)
August 11, 2026 16:13
fneum
disabled auto-merge
August 11, 2026 16:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2255.
Changes proposed in this Pull Request
"warning"againststatusinstead ofconditionrelease_notes.mdChecklist
Required:
doc/release_notes.md.