Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Overhaul PyROS Preprocessor Subroutine and Subproblem Objects#3341

Merged
blnicho merged 233 commits intoPyomo:mainfrom
shermanjasonaf:new-pyros-preprocessor-and-subproblems
Nov 6, 2024
Merged

Overhaul PyROS Preprocessor Subroutine and Subproblem Objects#3341
blnicho merged 233 commits intoPyomo:mainfrom
shermanjasonaf:new-pyros-preprocessor-and-subproblems

Conversation

@shermanjasonaf
Copy link
Contributor

@shermanjasonaf shermanjasonaf commented Aug 12, 2024

Fixes #2964.

Summary/Motivation:

Driven by recent algorithmic developments of the PyROS preprocessor, this PR implements sweeping changes to the PyROS preprocessor subroutine and subproblem formulations/object structures.

Changes proposed in this PR:

Update PyROS as follows:

  • Overhaul the preprocessor
    • Leverage decision rules and equality constraints to identify second-stage variables and state variables that are mathematically nonadjustable
    • More structured methods for reformulating variable domains/bounds to constraints
    • More structured methods for rearranging inequality constraints
    • Rewrite and extend coefficient matching: carefully account for state variable-independent constraints that cannot be reformulated by casting to inequality constraint pairs
  • Update the subproblem formulations and modeling objects
    • Modify block structures of the working model, master-like models, and separation model: partition the constraints by stage
    • Change the objective of the decision rule polishing problem to the 1-norm of the nonstatic terms of the decision rule expressions
    • Perform more careful initialization of the auxiliary uncertain parameter variables of the separation problem
  • Update the UncertaintySet class and pre-implemented subclasses to facilitate changes to the subproblems
    • Modify return protocol of UncertaintySet.set_as_constraint to make auxiliary uncertain parameters easier to track
    • Add new efficient methods for calculation of auxiliary uncertain parameter values for the CardinalitySet and FactorModelSet classes
    • Restrict range of valid FactorModelSet instances to those for which psi_mat is full column rank
    • Bug fix(es) for the IntersectionSet
  • Logging updates
    • Make log of the model component statistics slightly more informative
    • Add DEBUG-level messages for logging of the individual preprocessor steps
  • Documentation updates
    • Update "Methodology Overview" section
    • Add section on PyROS installation instructions
    • Adapt PyROS documentation to reorganized Pyomo documentation (post Reorganize online documentation #3382)
  • Make tests more rigorous and extensive
    • Address Restore PyROS failed separation problem test #2964
    • Use expression comparison methods (core.expr.compare.assertExpressionsEqual) for more precise model testing
    • Separate testing modules for the:
      • preprocessor
      • subproblem formulations
      • uncertainty set classes
        • more rigorous testing for point_in_set, set_as_constraint
      • PyROS solver as a whole

TODO

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
Copy link
Contributor Author

That's it for updates post #3382.

Copy link
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have anything that actually needs to be changed, just some stylistic suggestions. Overall it looks good.

@codecov
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 97.27685% with 18 lines in your changes missing coverage. Please review.

Project coverage is 88.66%. Comparing base (ad90ee2) to head (58c6526).
Report is 615 commits behind head on main.

Files with missing lines Patch % Lines
pyomo/contrib/pyros/solve_data.py 82.75% 5 Missing ⚠️
pyomo/contrib/pyros/uncertainty_sets.py 97.50% 5 Missing ⚠️
pyomo/contrib/pyros/master_problem_methods.py 98.26% 3 Missing ⚠️
pyomo/contrib/pyros/pyros_algorithm_methods.py 95.77% 3 Missing ⚠️
pyomo/contrib/pyros/separation_problem_methods.py 98.78% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3341      +/-   ##
==========================================
+ Coverage   88.57%   88.66%   +0.08%     
==========================================
  Files         883      883              
  Lines      100343   100156     -187     
==========================================
- Hits        88882    88800      -82     
+ Misses      11461    11356     -105     
Flag Coverage Δ
linux 86.25% <93.93%> (+0.20%) ⬆️
osx 76.22% <91.81%> (+0.17%) ⬆️
other 86.75% <93.93%> (+0.20%) ⬆️
win 84.60% <93.78%> (+0.21%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Restore PyROS failed separation problem test

5 participants