Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Add logic for highspy versions #3509

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

mrmundt
Copy link
Contributor

@mrmundt mrmundt commented Mar 7, 2025

Fixes #3489

Summary/Motivation:

There is a new feature in highspy that allows keyboard interruption. It's not available in old versions. This PR checks the version to make sure it meets the minimum requirement.

Changes proposed in this PR:

  • Ensure that version is at least 1.8 before setting keyboard interrupt

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@mrmundt mrmundt requested a review from michaelbynum March 7, 2025 18:42
@michaelbynum michaelbynum merged commit db80ff9 into Pyomo:main Mar 7, 2025
62 of 63 checks passed
@mrmundt mrmundt deleted the highspy-patch branch March 7, 2025 23:12
Comment on lines +276 to +277
if self.version()[0] >= 1 and self.version()[1] >= 8:
self._solver_model.HandleKeyboardInterrupt = True
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, there is a bug in this logic, as version 2.0 will not HandleKeyboardInterrupt. An improved implementation would be:

if self.version()[:2] >= (1, 8):

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.

highspy >=1.8.0 required but this is not checked
3 participants