pyomo icon indicating copy to clipboard operation
pyomo copied to clipboard

[WIP] Rewrite PyROS `UncertaintySet` Docstrings and Improve Validation Robustness

Open shermanjasonaf opened this issue 2 years ago • 2 comments

Changes proposed in this PR:

  • extend valid numeric types to core.expr.numvalue.native_numeric_types; add finiteness checks for numeric types (including for array-like entries)
  • more rigorous validation of structure (shapes and sizes) of array-like arguments to UncertaintySet constructors
  • detail Exception messages for type and value checks to the level of single immutable values (such as an entry of an array, etc.)
  • rewrite docstrings for PyROS uncertainty_sets submodule and all classes/methods defined within

TODO

  • [ ] Add comprehensive unit test set (wait until after #2543 merged to avoid conflicts)
  • [ ] 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.

shermanjasonaf avatar Aug 15 '22 22:08 shermanjasonaf

@shermanjasonaf what's the status with this PR, is it ready for review?

blnicho avatar Aug 30 '22 18:08 blnicho

Codecov Report

Base: 81.42% // Head: 84.94% // Increases project coverage by +3.51% :tada:

Coverage data is based on head (b40f427) compared to base (2c89f25). Patch coverage: 100.00% of modified lines in pull request are covered.

:exclamation: Current head b40f427 differs from pull request most recent head 20f1fd0. Consider uploading reports for the commit 20f1fd0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2488      +/-   ##
==========================================
+ Coverage   81.42%   84.94%   +3.51%     
==========================================
  Files         754      748       -6     
  Lines       83428    83493      +65     
==========================================
+ Hits        67935    70923    +2988     
+ Misses      15493    12570    -2923     
Flag Coverage Δ
linux 84.47% <100.00%> (?)
osx 74.92% <100.00%> (?)
other 84.66% <100.00%> (?)
win 81.36% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyomo/contrib/pyros/uncertainty_sets.py 91.82% <ø> (+10.19%) :arrow_up:
pyomo/contrib/pyros/pyros.py 93.19% <100.00%> (-1.05%) :arrow_down:
pyomo/contrib/pynumero/linalg/ma27.py 26.31% <0.00%> (-71.58%) :arrow_down:
pyomo/solvers/plugins/solvers/mosek_persistent.py 31.73% <0.00%> (-62.51%) :arrow_down:
pyomo/contrib/pynumero/linalg/ma27_interface.py 20.48% <0.00%> (-56.63%) :arrow_down:
pyomo/solvers/plugins/solvers/mosek_direct.py 14.91% <0.00%> (-53.89%) :arrow_down:
pyomo/contrib/pynumero/linalg/utils.py 40.00% <0.00%> (-50.00%) :arrow_down:
pyomo/solvers/plugins/solvers/CPLEX.py 38.33% <0.00%> (-46.48%) :arrow_down:
...mo/contrib/interior_point/linalg/ma27_interface.py 46.42% <0.00%> (-46.43%) :arrow_down:
pyomo/contrib/viewer/ui.py 29.87% <0.00%> (-44.52%) :arrow_down:
... and 149 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Aug 31 '22 15:08 codecov[bot]

@shermanjasonaf what's the status with this PR, is it ready for review?

Ready for review. Can you add @natalieisenberg as one of the reviewers?

shermanjasonaf avatar Nov 10 '22 01:11 shermanjasonaf