Skip to content

feat: termination condition mapping for highs solver#440

Merged
FabianHofmann merged 2 commits into
PyPSA:masterfrom
ollie-bell:highs-termination-condition-mapping
Apr 15, 2025
Merged

feat: termination condition mapping for highs solver#440
FabianHofmann merged 2 commits into
PyPSA:masterfrom
ollie-bell:highs-termination-condition-mapping

Conversation

@ollie-bell
Copy link
Copy Markdown
Contributor

@ollie-bell ollie-bell commented Apr 14, 2025

Closes # (if applicable).

Changes proposed in this Pull Request

Explicit mapping from highs model status to linopy termination conditions. Previously it was relying on calling .lower() on the output of h.modelStatusToString, but that only captures the optimal and infeasible cases.

See https://github.com/ERGO-Code/HiGHS/blob/fd8665394edfd096c4f847c4a6fbc187364ef474/src/lp_data/HighsModelUtils.cpp#L1330 for the outputs of h.modelStatusToString.

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).
  • 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.

@ollie-bell ollie-bell marked this pull request as ready for review April 14, 2025 13:12
Copy link
Copy Markdown
Collaborator

@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.

@ollie-bell great work! thank you! @siddharth-krishna could you have a short look if that is affecting your benchmark results in any case?

@FabianHofmann FabianHofmann merged commit 35b5d91 into PyPSA:master Apr 15, 2025
21 checks passed
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.

2 participants