-
Notifications
You must be signed in to change notification settings - Fork 562
Fixing bugs in GDPopt preprocessing #2211
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
Conversation
…traints in contrib.deactivate_trivial_constraints, which fixes Pyomo#2171
…l_constraints should actually raise an InfeasibleConstraintException, rather than a ValueError...
…h the gdpopt set covering initialization, where equality constraints are infeasible. I think I'm barking up the wrong tree.
…r conflicting fixed values in propogate_fixed_vars
…straintErrors rather than ValueErrors when they encounter infeasible constraints. This is consistent with what GDPopt expects when it encounters infeasible subproblems.
…ts. Not in a clever way, as it just ignores equality constraints with constants for the moment, which is actually what the docstring promises. Also fixes tests that were expecting ValueErrors where now there are InfeasibleConstraintExceptions
…raintExceptions, logging the exceptions because I think that might be helpful
…ueError from deactivate_trivial_constraints
Codecov Report
@@ Coverage Diff @@
## main #2211 +/- ##
==========================================
+ Coverage 82.99% 83.14% +0.15%
==========================================
Files 607 607
Lines 76774 77578 +804
==========================================
+ Hits 63718 64503 +785
- Misses 13056 13075 +19
Continue to review full report at Codecov.
|
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 fine, but we should re-implement the transformation to handle non-zero constants in the trivial linear equality expressions.
If we merge this without fixing the transformation, we should at least create an issue to revisit the problem. I think fixing the transformation should only take ~15 minutes, though.
|
@jsiirola I'm going to merge this and open an issue about the transformation. Because what to do about constants depends on how we resolve #2204, I think. Because currently a constraint like |
Fixes #2101, #2171
Summary/Motivation:
GDPopt calls a series of transformations from
contrib.preprocessingon the NLP subproblems prior to solving them, and it assumes that if they are found infeasible during preprocessing, those transformations will throw anInfeasibleConstraintException. However, many of them threw aValueErrorwhen they found infeasible constraints. This PR modifies them all to throw anInfeasibleConstraintException. In addition, it fixes a bug incontrib.propagate_fixed_varswhere constraints of the formx == y + constantwere mistakenly treated asx == y, and could result in fixing variables to infeasible values.Changes proposed in this PR:
contrib.propagate_fixed_vars,contrib.deactivate_trivial_constraints, andcontrib.propagate_eq_var_boundsto be InfeasibleConstraintExceptionscontrib.propagate_fixed_varsto ignore constraints of the formx == y + constantwhen one ofxoryis not already fixed prior to the transformation call. This is consistent with what the docstring promises and fixes the silent failure from Propagate_fixed_vars transformation does not handle constants in standard repn #2101, so it seems worth doing for now. However, I think that we should have a discussion about what behavior we actually want: maybe we should handle these types of constraints.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: