Skip to content

Update PyROS Uncertainty Set Implementations - #4043

Open
shermanjasonaf wants to merge 26 commits into
Pyomo:mainfrom
shermanjasonaf:pyros-revisit-intersection-cartesian-product
Open

shermanjasonaf wants to merge 26 commits into
Pyomo:mainfrom
shermanjasonaf:pyros-revisit-intersection-cartesian-product

Conversation

@shermanjasonaf

Copy link
Copy Markdown
Contributor

Summary/Motivation:

This PR makes changes to the PyROS UncertaintySet class and most of the pre-implemented concrete subclasses included in the PyROS uncertainty sets module.

Changes proposed in this PR:

1. Add a generic scenarios attribute to the UncertaintySet base class

This attribute is designed to return the points comprising the set represented by an UncertaintySet instance, if the set is known to be discrete (i.e., of geometry Geometry.DISCRETE_SCENARIOS).

2. Update the pre-implemented concrete UncertaintySet subclasses

  • AxisAlignedEllipsoidalSet
    • Speed up and simplify parameter_bounds.
    • Simplify the center and half_lengths setters.
  • BudgetSet
    • Simplify the budget_rhs_vec and budget_membership_mat setters.
  • CardinalitySet
    • Simplify the origin, negative_deviation, and positive_deviation setters.
  • CartesianProductSet
    • Modify the constructor interface to support specification of the operands by allowing arbitrarily many positional arguments (i.e., allow CartesianProductSet(*args)). Deprecate the constructor interface of Add CartesianProductSet to PyROS #3927.
  • DiscreteScenarioSet
    • Simplify the scenarios setter.
  • EllipsoidalSet
    • Use SciPy Cholesky factorization-based routines in lieu of generic NumPy linear algebra routines to enhance set validation, membership checks, and constraint generation.
    • Speed up and simplify parameter_bounds.
    • Simplify the center and shape_matrix setters.
  • IntersectionSet
    • Modify the constructor interface to support specification of the operands positionally (i.e., through IntersectionSet(*args)) rather than by keyword. Deprecate keyword-based operand specification. Thus, the new IntersectionSet constructor is designed to more closely match that of CartesianProductSet.
    • Modify the scenarios property (introduced in Fix PyROS IntersectionSet Implementation #3786) for improved performance.
    • Fix is_nonempty() for cases where the intersection is discrete.
    • Simplify the validate() and set_as_constraint() methods.
    • Simplify the all_sets setter.
  • PolyhedralSet
    • Simplify the coefficients_mat and rhs_vec setters.

3. Update the documentation of the Geometry enum

This change clarifies the significance of the Geometry enum and the attribute UncertaintySet.geometry.

AI-Use Disclosure

The calls to SciPy Cholesky factorization-based routines, used in the updated EllipsoidalSet implementation, are based on context-independent AI-generated code and have been adapted by me before committing.

  • AI tools contributed to the development of this PR

    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.

Notes for reviewers (optional):

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

@blnicho
blnicho requested review from blnicho and jsiirola September 29, 2026 18:37
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.

1 participant