-
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
Warn when infeasibility tools will not log output #2666
Conversation
Codecov ReportBase: 87.05% // Head: 87.05% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2666 +/- ##
=======================================
Coverage 87.05% 87.05%
=======================================
Files 757 757
Lines 84443 84449 +6
=======================================
+ Hits 73512 73518 +6
Misses 10931 10931
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
pyomo/util/infeasible.py
Outdated
logger.warning( | ||
'log_infeasible_constraints() called with a logger whose ' | ||
'effective level is higher than logging.INFO: no output ' | ||
'will be logged reguardless of constraint feasibility' |
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.
Repeated Typo: regardless
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.
Should this warning include a note on how to change the logging level?
"This warning can be avoided by changing the Pyomo logging level: <CODE TO CHANGE LOGGING LEVEL>
"
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 don't think so. There are too many ways to change the logging level (adding handlers, calling a standard setup, setting the logging level) to put something specific here. If we start to see a bunch of questions about it, then we can add a reference to the online docs (in the Common Warnings/Errors list) -- where we can have a longer and more detailed discussion.
Fixes # .
Summary/Motivation:
One of our developers was recently burned by using
log_infeasible_constraints()
and assuming that because they didn't see any output that the model was feasible. In fact the model was infeasible; but, because the default Pyomo logging level is WARNING, the log messages were suppressed.This PR is a quick fix to emit a warning when the infeasibility tools are called with a logger that will not output INFO level messages.
Changes proposed in this PR:
pyomo.util.infeasible.log_*()
will not emit INFO level messagesLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: