Replace deprecated Pyomo 'undo' with 'reverse' for relax_integer_vars#631
Closed
DLWoodruff wants to merge 4 commits into
Closed
Replace deprecated Pyomo 'undo' with 'reverse' for relax_integer_vars#631DLWoodruff wants to merge 4 commits into
DLWoodruff wants to merge 4 commits into
Conversation
Pyomo 6.9.3 deprecated the 'undo' option in core.relax_integer_vars in favor of 'reverse'. Updated both occurrences in integer_relax_then_enforce.py and nonant_sensitivities.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pyomo's new API returns a ReverseTransformationToken from apply_to() which must be passed back to reverse the transformation. Passing reverse=True no longer works. Save the token from the initial apply_to() call and use it when reversing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bknueven
approved these changes
Mar 19, 2026
Collaborator
bknueven
left a comment
There was a problem hiding this comment.
Does this impose a higher minimum Pyomo version than we currently have?
Collaborator
Author
|
It bumps the requirement from 6.4 to 6.9.3 so I will mark this one as draft for a while |
The reverse transformation token API used by the relax_integer_vars changes was introduced in Pyomo 6.9.3. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #631 +/- ##
=======================================
Coverage ? 65.09%
=======================================
Files ? 149
Lines ? 18392
Branches ? 0
=======================================
Hits ? 11973
Misses ? 6419
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
undooption in thecore.relax_integer_varstransformation in favor ofreverseinteger_relax_then_enforce.pyandnonant_sensitivities.pyTest plan
run_all.pywith the sslp test that uses--integer-relax-then-enforceand confirm no deprecation warning🤖 Generated with Claude Code