Skip to content

Adjust PyROS handling of separation objective evaluation errors #3646

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shermanjasonaf
Copy link
Contributor

Summary/Motivation:

Upon the solution of a separation problem, PyROS attempts to evaluate the violations of all second-stage inequality constraints at the optimal solution to that separation problem. In (rare) cases, the evaluation may fail due to an exception encountered/raised by the Pyomo expression evaluators. This exception may be of type ValueError or ArithmeticError. Currently, PyROS does not handle an exception of type ArithmeticError and handles a ValueError-type exception as follows:

  • Issue INFO-level logging messages reporting the names and values of all first-stage variables and second-stage variables of the separation model
  • Raise an ArithmeticError with a message of the form "Evaluation . . . of constraint . . . led to a math domain error. Does the constraint contain . . . functions . . . with tricky domains?"

In this PR, we modify PyROS to handle an exception of type ValueError or ArithmeticError as follows:

  • Issue an ERROR-level logging message reporting that PyROS encountered an evaluation error, and including the names and values of all variables of the separation model (including variables representing uncertain parameters) that appear in the expression
  • Reraise the exception

Changes proposed in this PR:

See above.

TODO (after #3558 merged)

  • Update version number, changelog

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:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant