-
Notifications
You must be signed in to change notification settings - Fork 57
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
Handle function evaluation errors #210
Comments
In an initial test, returning |
We'll definitely review pull requests that try to address this. Feel free to submit something though if you are digging into it. |
This appears to be because Ipopt only handles function evaluation errors in the objective and constraint callbacks, and I was testing an error in the Jacobian callback. This is a little inconvenient for the user, but there is nothing to stop us from returning false and letting Ipopt handle this how it chooses. |
Ipopt function/derivative callbacks should return false if there was a problem with the evaluation. This way Ipopt can try to recover by cutting the step size and trying again.
This does not appear to be supported in CyIpopt. For example, here in the constraint callback,
True
is returned even if an exception is encountered. I'm not sure how this exception is then processed. When my callback Python code raises an exception, I get "Stopping optimization at current point as requested by user" and my Python exception is re-raised.I propose that there should be a particular type of exception, e.g.
CyIpoptEvaluationError
, that will cause CyIpopt evaluation callbacks to returnFalse
to Ipopt (and are otherwise ignored by CyIpopt).Does this sound like a reasonable way to handle evaluation errors? If so, I'm happy to try to implement this.
The text was updated successfully, but these errors were encountered: