Migrate sizes harness invocations to generic_cylinders.py#660
Merged
DLWoodruff merged 2 commits intoPyomo:mainfrom Apr 21, 2026
Merged
Migrate sizes harness invocations to generic_cylinders.py#660DLWoodruff merged 2 commits intoPyomo:mainfrom
DLWoodruff merged 2 commits intoPyomo:mainfrom
Conversation
sizes.py already exposes scenario_creator, scenario_names_creator, kw_creator, inparser_adder, scenario_denouement, and the model-specific _rho_setter/id_fix_list_fct hooks. The generic driver can run it. - Archive examples/sizes/sizes_ef.py (no callers anywhere), sizes_ph.py (no callers), and sizes_pysp.py (only called from run_all.py) under examples/sizes/archive/. - run_all.py: replace the archived sizes_pysp.py EF call with `generic_cylinders.py --module-name sizes --EF`; add a parallel `generic_cylinders.py` PH invocation next to the rst-documented sizes_cylinders.py entry so the harness exercises both. - doc/src/examples.rst: reword the sizes blurb to point new users at the generic driver, noting sizes_cylinders.py is retained as a worked example and sizes_demo.py as the serial variant used by the extensions docs. sizes_cylinders.py (rst-referenced in examples.rst), sizes_demo.py (heavily rst-referenced in extensions.rst, drivers.rst, examples.rst), sizes_expression.py (used by generic_tester.py for the lp/mps path), and special_cylinders.py/special_sizes.py are all retained. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #660 +/- ##
==========================================
+ Coverage 70.73% 70.74% +0.01%
==========================================
Files 153 153
Lines 19011 19011
==========================================
+ Hits 13447 13449 +2
+ Misses 5564 5562 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bknueven
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/sizes/sizes_ef.py,sizes_ph.py, andsizes_pysp.pyunderexamples/sizes/archive/. The first two have no callers anywhere; the PySP-based EF driver is only referenced fromrun_all.pyand is redundant withgeneric_cylinders.py --EF.examples/run_all.py: replace thesizes_pysp.pyEF line withgeneric_cylinders.py --module-name sizes --EF, and add a parallelgeneric_cylinders.pyPH entry alongside the rst-documentedsizes_cylinders.pyone so the harness exercises both patterns.doc/src/examples.rst: reword the sizes section to point new users at the generic driver;sizes_cylinders.pyis retained as the worked cylinders example andsizes_demo.pyas the serial variant used by the extensions docs.Retained in the directory (all still used):
sizes.py(model module),sizes_cylinders.py(examples.rst),sizes_demo.py(cited ~8x across drivers/examples/extensions rst),sizes_expression.py(exercised bygeneric_tester.pyfor the lp/mps path),special_cylinders.py/special_sizes.py(used byrun_all.pydeveloper-only path andtryone.py).Test plan
python ../../mpisppy/generic_cylinders.py --module-name sizes --num-scens=3 --EF --EF-solver-name=gurobi_persistent— objective 224275.33mpiexec -np 3 python -m mpi4py ../../mpisppy/generic_cylinders.py --module-name sizes --num-scens=10 --max-iterations=5 --default-rho=1 --lagrangian --xhatxbar --linearize-proximal-terms --iter0-mipgap=0.01 --iterk-mipgap=0.001 --solver-name=gurobi_persistent— PH + lagrangian + xhatxbar converges to 1.5% cylinder gapruff check examples/run_all.py🤖 Generated with Claude Code