pyomo icon indicating copy to clipboard operation
pyomo copied to clipboard

Fix PyROS Iteration Logging for Edge Case Involving Discrete Sets

Open shermanjasonaf opened this issue 1 year ago • 1 comments

Summary/Motivation:

If PyROS is invoked with an instance of DiscreteScenarioSet passed through argument uncertainty_set, then due to currently implemented algorithmic efficiencies, all separation problems are skipped in the event the iteration number is equal to one less than the number of scenarios in the uncertainty set. In this case, the #CViol entry in the final line of the iteration log should be 0, rather than 0+, which is what is currently printed.

For example, if the DiscreteScenarioSet has only a single scenario, and the first PyROS iteration is successfully completed, then the iteration log will currently read:

Itn  Objective    1-Stg Shift  2-Stg Shift  #CViol  Max Viol     Wall Time (s)
------------------------------------------------------------------------------
0    X.XXXXe+XX   X.XXXXe+XX   X.XXXXe+XX   0+      -            XX.XXX

(where the Xs are placeholders) rather than the desired output:

Itn  Objective    1-Stg Shift  2-Stg Shift  #CViol  Max Viol     Wall Time (s)
------------------------------------------------------------------------------
0    X.XXXXe+XX   X.XXXXe+XX   X.XXXXe+XX   0       -            XX.XXX

Changes proposed in this PR:

  • Fix/simplify PyROS iteration logs for DiscreteScenarioSet edge case.

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 Feb 28 '24 03:02 shermanjasonaf

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.38%. Comparing base (e30aea7) to head (039acdc). Report is 25 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3170   +/-   ##
=======================================
  Coverage   88.38%   88.38%           
=======================================
  Files         846      846           
  Lines       94855    94859    +4     
=======================================
+ Hits        83834    83839    +5     
+ Misses      11021    11020    -1     
Flag Coverage Δ
linux 86.33% <80.00%> (-0.01%) :arrow_down:
osx 75.73% <80.00%> (-0.01%) :arrow_down:
other 86.52% <80.00%> (-0.01%) :arrow_down:
win 83.81% <80.00%> (-0.01%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 28 '24 17:02 codecov[bot]