Skip to content

Extend the PyROS CardinalitySet to allow negative deviations#3969

Merged
mrmundt merged 9 commits into
Pyomo:mainfrom
shermanjasonaf:pyros-extend-cardinality-set-2
Jun 3, 2026
Merged

Extend the PyROS CardinalitySet to allow negative deviations#3969
mrmundt merged 9 commits into
Pyomo:mainfrom
shermanjasonaf:pyros-extend-cardinality-set-2

Conversation

@shermanjasonaf
Copy link
Copy Markdown
Contributor

@shermanjasonaf shermanjasonaf commented Jun 1, 2026

Summary/Motivation:

This PR extends the family of uncertainty sets that can be represented by the PyROS CardinalitySet. The current implementation of CardinalitySet supports the family of "cardinality-constrained" or "budgeted" sets defined in Poss (2013) and Subramanyam et al (2020); for any member of that family, only positive coordinate deviations from the "origin" of the set are allowed. In contrast, cardinality-constrained sets defined in, for example, Bertsimas and Sim (2004) allow for positive and negative coordinate deviations from the origin. We therefore extend the implementation of CardinalitySet to support sets in which positive and/or negative deviations are allowed. The documentation and tests are updated to account for this extension.

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

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 a review from jsiirola June 2, 2026 18:39
Copy link
Copy Markdown
Member

@jsiirola jsiirola left a comment

Choose a reason for hiding this comment

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

Overall, this looks good. A couple minor questions, but I don't think they are anything that would hold up the PR.

Comment thread pyomo/contrib/pyros/uncertainty_sets.py Outdated
Comment thread pyomo/contrib/pyros/uncertainty_sets.py Outdated
Comment thread pyomo/contrib/pyros/uncertainty_sets.py Outdated
Comment thread pyomo/contrib/pyros/uncertainty_sets.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (44c4697) to head (bf99cde).
⚠️ Report is 116 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3969   +/-   ##
=======================================
  Coverage   90.12%   90.12%           
=======================================
  Files         909      909           
  Lines      108561   108582   +21     
=======================================
+ Hits        97836    97857   +21     
  Misses      10725    10725           
Flag Coverage Δ
builders 29.11% <12.76%> (+<0.01%) ⬆️
default 86.11% <100.00%> (?)
expensive 35.12% <12.76%> (?)
linux 87.63% <100.00%> (-1.99%) ⬇️
linux_other 87.63% <100.00%> (+<0.01%) ⬆️
oldsolvers 28.04% <12.76%> (+<0.01%) ⬆️
osx 83.06% <100.00%> (+<0.01%) ⬆️
win 85.38% <100.00%> (+<0.01%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jsiirola
Copy link
Copy Markdown
Member

jsiirola commented Jun 3, 2026

One more question: does this need to update the changelog?

@mrmundt mrmundt merged commit e074b34 into Pyomo:main Jun 3, 2026
63 of 65 checks passed
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.

5 participants