-
Notifications
You must be signed in to change notification settings - Fork 552
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
Update PyROS Uncertainty Set Validation Methods #3558
Conversation
@shermanjasonaf @jsiirola I have addressed all comments. I would appreciate further feedback on my implementations for |
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 looks good. @jas-yao, @shermanjasonaf: do you want to update the version & changelog as part of this PR before we merge it, or just add it to the next PR?
Co-authored-by: Bethany Nicholson <[email protected]>
Co-authored-by: Bethany Nicholson <[email protected]>
Co-authored-by: Bethany Nicholson <[email protected]>
Co-authored-by: Bethany Nicholson <[email protected]>
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.
There are two doc issues (missing variables names), but this is otherwise lovely.
|
||
Returns | ||
------- | ||
: bool |
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.
The actual varname is missing here.
|
||
Returns | ||
------- | ||
: list of tuple |
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.
The actual varname is missing here.
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.
These are return values, so the actual var name is not necessary (or really all that relevant). I believe that this is syntactically correct numpydoc (the :
just makes it explicit that we are providing the return type and are not specifying a (suggested) name.
@jas-yao This looks good. You may want to remove the custom implementation of |
@jsiirola Let's leave the version number and changelog updates for #3649. |
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: