-
Notifications
You must be signed in to change notification settings - Fork 518
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
change default behavior in appsi to not care where variables live #2903
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2903 +/- ##
==========================================
+ Coverage 87.81% 87.82% +0.01%
==========================================
Files 770 770
Lines 89626 89641 +15
==========================================
+ Hits 78701 78728 +27
+ Misses 10925 10913 -12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very happy! :)
pyomo/contrib/appsi/base.py
Outdated
# this has to be done after the objective in case the | ||
# old objective uses old variables | ||
timer.start('vars') | ||
self.remove_variables(old_vars) | ||
timer.stop('vars') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I'm understanding, it has to be after constraints for the same reason, right? (It just already was.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good point. Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the comment
Haha, good! |
Fixes #2888.
Summary/Motivation:
This PR
update
where an error was raised when removing variables that were used in the old objective but not the new objective.only_child_vars=True
andonly_child_vars=False
. This is the flag that controls how variables are gathered (by traversing the model or from the active constraints/objective).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: