-
Notifications
You must be signed in to change notification settings - Fork 62
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
improved error message. #1412
improved error message. #1412
Conversation
@@ -158,7 +158,9 @@ def _scale_constraints(self, blk): | |||
self._cleanup() | |||
raise RuntimeError( | |||
"Error in AMPL evaluation.\n" | |||
"Run ipopt with halt_on_ampl_error=yes and symbolic_solver_labels=True to see the affected function." | |||
"Re-run ipopt with:\n" | |||
'1. solver options = {"halt_on_ampl_error" : "yes", "nlp_scaling_method" : "gradient-based"\n' |
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 am forgetting- should nlp_scaling_method
be what you have here or user-scaling
? What happens if you don't specify gradient -based scaling?
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 option ensures watertap's own scaling gets skipped and the model gets handed directly to Ipopt. This is what we want to see the problematic constraint / expression.
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 just thought I remembered this working regardless of that option so maybe I'm not recalling correctly.
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.
It certainly does in IDAES or if you just use SolverFactory("ipopt")
.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1412 +/- ##
=======================================
Coverage 94.01% 94.01%
=======================================
Files 335 335
Lines 35561 35561
=======================================
Hits 33431 33431
Misses 2130 2130 ☔ View full report in Codecov by Sentry. |
* improved error message. * run black.
Fixes/Resolves:
Provides better instructions for debugging scaling problems, e.g., 0/0 calculations to identify which function the error is coming from.
Summary/Motivation:
Making the debugging process easier
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: