-
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
[WIP] CyIpopt callback for displaying variables/constraints causing infeasibilities #2860
Conversation
…lem so we can call e.g. get_current_iterate
…nto cyipopt-callback
@blnicho Raised the possibility of forking CyIpopt and creating a tag that we can pin against for testing. Another advantage of forking CyIpopt is that we could (potentially) patch it to search for the IDAES-installed Ipopt, so that cyipopt (and therefore this callback) would be available with simply:
Not as simple as |
Tests are failing as I have broken the callback API. This can be handled by using The alternative is to just break the callback API. This doesn't seem like a good idea, as we have callback examples in |
Windows coverage failure appears unrelated |
@Robbybp looks like cyipopt 1.3.0 was released a couple days ago so this PR can now move forward when you have time to come back to it. |
@blnicho Thanks for the FYI. I want to test this out with some users other than myself before merging. The CyIpopt release will make this much easier. |
I'm actually starting to use this, and I think this needs a bit more development before it is ready, so I'm going to close this PR for now. Things I need to think about:
|
Summary/Motivation:
One advantage of using CyIpopt over Ipopt is the ability to interact with the solver via a callback. Another advantage is that we can associate the solver's data structures with Pyomo variables and constraints, which might have more meaning for a user. This PR combines these capabilities by introducing a callback that displays the variables and constraints that correspond to the highest-magnitude infeasibilities each iteration of a solve.
This PR will not work until CyIpopt publishes a new release, but I wanted to open it for feedback and possibly solicit some ambitious users.
This PR needs:
Ideally, eventually, we could automatically link CyIpopt to the IDAES-provided Ipopt library, so that users can obtain this functionality with a simple
pip install cyipopt
. Then I envision the callback being enabled with something likeBreaking change
Note that this is a breaking change to the call signature of the intermediate callback that our CyIpopt interface,
CyIpoptNLP
, expects. We now expect an argument forself
, the instance ofcyipopt.Problem
, which is necessary for calling theget_current_iterate
andget_current_violations
methods. We could think about how to do this in a non-breaking manner (usinginspect
to branch on the signature of the callback) or how to update the signature to be more extensible (accept a dictionary as an argument that we can add to if/when ever we want to add more arguments to the callback).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: