-
Notifications
You must be signed in to change notification settings - Fork 546
Update PyROS Uncertainty Set Validation Methods #3558
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
base: main
Are you sure you want to change the base?
Conversation
@jsiirola @shermanjasonaf Thank you for all of your feedback! I have addressed most comments, with the remaining being mostly related to rewriting the |
@shermanjasonaf @jsiirola I have addressed all comments. I would appreciate further feedback on my implementations for |
# check when values are not finite | ||
cardinality_set.origin[0] = np.nan | ||
exc_str = ( | ||
r"Entry 'nan' of the argument `origin` " r"is not a finite numeric value" |
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.
r"Entry 'nan' of the argument `origin` " r"is not a finite numeric value" | |
r"Entry 'nan' of the argument `origin` is not a finite numeric value" |
# check when values are not finite | ||
a_ellipsoid_set.center[0] = np.nan | ||
exc_str = ( | ||
r"Entry 'nan' of the argument `center` " r"is not a finite numeric value" |
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.
r"Entry 'nan' of the argument `center` " r"is not a finite numeric value" | |
r"Entry 'nan' of the argument `center` is not a finite numeric value" |
# check when values are not finite | ||
ellipsoid_set.center[0] = np.nan | ||
exc_str = ( | ||
r"Entry 'nan' of the argument `center` " r"is not a finite numeric value" |
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.
r"Entry 'nan' of the argument `center` " r"is not a finite numeric value" | |
r"Entry 'nan' of the argument `center` is not a finite numeric value" |
# check when values are not finite | ||
polyhedral_set.rhs_vec[0] = np.nan | ||
exc_str = ( | ||
r"Entry 'nan' of the argument `rhs_vec` " r"is not a finite numeric value" |
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.
r"Entry 'nan' of the argument `rhs_vec` " r"is not a finite numeric value" | |
r"Entry 'nan' of the argument `rhs_vec` is not a finite numeric value" |
Fixes: #2724, #3508
Summary/Motivation:
This PR provides updates to PyROS uncertainty set validation methods and related tests.
Here, a
validate
method replaces theis_valid
method (which solves 2N bounding problems to check for set boundedness) in all uncertainty sets, with each set having its own customvalidate
method that efficiently checks set-specific attributes and raises informative exceptions if any issues are found.Changes proposed in this PR:
is_bounded
andis_nonempty
methods in baseUncertaintySet
class_solve_feasibility
method in baseUncertaintySet
classis_valid
withvalidate
method that runsis_bounded
andis_nonempty
in the baseUncertaintySet
classvalidate
in subclass uncertainty sets to check set-specific attributesvalidate
methodis_bounded
,is_nonempty
,_solve_feasibility
, andvalidate
methodsTODO
_compute_parameter_bounds
validate_array
to allvalidate
methodstest_validate
tests into separate tests for each validation check_validate
method forPolyhedralSet
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: