Skip to content

WIP: Solution Pool #3657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

WIP: Solution Pool #3657

wants to merge 23 commits into from

Conversation

whart222
Copy link
Member

@whart222 whart222 commented Jul 9, 2025

Fixes #3513 (partially) .

Summary/Motivation:

The alternative_solutions contrib package includes a rudimentary solution pool object. This PR includes a more comprehensive capability for defining and managing solution pools.

Changes proposed in this PR:

  • PyomoPoolManager - Manages pools for Pyomo solutions
  • SolutionPool* - Classes used to define various solution pools
  • Functions in pyomo.contrib.alternative_solutions now use and return PyomoPoolManager instances.
  • PyomoSolution - Function that returns a Solution object given Pyomo model data

NOTE: This is a WIP PR. I'm submitting this now to help define expectations for finalizing this new capability.

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.

@whart222 whart222 requested review from michaelbynum and emma58 July 9, 2025 09:15
@whart222 whart222 marked this pull request as draft July 9, 2025 09:16
whart222 added 3 commits July 9, 2025 05:19
Use the Pyomo Bunch class as an alias for Munch, to avoid
introducing an additional Pyomo dependency.
@whart222
Copy link
Member Author

whart222 commented Jul 9, 2025

Note that this PR now includes updates to the Bunch class defined in pyomo.common. I have been using the public Munch class, but these revisions align the Bunch API with Munch.

whart222 added 10 commits July 9, 2025 06:38
Avoiding use of KW_ONLY, which is an internal mechanism
Using new serialization API, which is simpler. :)
1. Reworking solver matrix logic

2. Fixing test to benchmark against the solution values
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 90.61785% with 41 lines in your changes missing coverage. Please review.

Project coverage is 87.00%. Comparing base (10d6acc) to head (834cd95).

Files with missing lines Patch % Lines
pyomo/contrib/alternative_solutions/solnpool.py 88.54% 26 Missing ⚠️
pyomo/contrib/alternative_solutions/solution.py 90.09% 10 Missing ⚠️
pyomo/contrib/alternative_solutions/balas.py 81.81% 2 Missing ⚠️
...o/contrib/alternative_solutions/gurobi_solnpool.py 94.44% 2 Missing ⚠️
pyomo/contrib/alternative_solutions/aos_utils.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3657      +/-   ##
==========================================
- Coverage   89.05%   87.00%   -2.05%     
==========================================
  Files         890      820      -70     
  Lines      102617   101335    -1282     
==========================================
- Hits        91384    88167    -3217     
- Misses      11233    13168    +1935     
Flag Coverage Δ
builders ?
linux 86.78% <90.61%> (-2.03%) ⬇️
linux_other 86.78% <90.61%> (+<0.01%) ⬆️
osx 83.11% <90.61%> (+0.01%) ⬆️
win 84.99% <90.61%> (+0.01%) ⬆️
win_other 84.99% <90.61%> (+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.

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.

Adding solution pool functionality to Pyomo
1 participant