Skip to content

Migrate sizes harness invocations to generic_cylinders.py#660

Merged
DLWoodruff merged 2 commits intoPyomo:mainfrom
DLWoodruff:sizes_update
Apr 21, 2026
Merged

Migrate sizes harness invocations to generic_cylinders.py#660
DLWoodruff merged 2 commits intoPyomo:mainfrom
DLWoodruff:sizes_update

Conversation

@DLWoodruff
Copy link
Copy Markdown
Collaborator

Summary

  • Archive examples/sizes/sizes_ef.py, sizes_ph.py, and sizes_pysp.py under examples/sizes/archive/. The first two have no callers anywhere; the PySP-based EF driver is only referenced from run_all.py and is redundant with generic_cylinders.py --EF.
  • examples/run_all.py: replace the sizes_pysp.py EF line with generic_cylinders.py --module-name sizes --EF, and add a parallel generic_cylinders.py PH entry alongside the rst-documented sizes_cylinders.py one so the harness exercises both patterns.
  • doc/src/examples.rst: reword the sizes section to point new users at the generic driver; sizes_cylinders.py is retained as the worked cylinders example and sizes_demo.py as 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 by generic_tester.py for the lp/mps path), special_cylinders.py / special_sizes.py (used by run_all.py developer-only path and tryone.py).

Test plan

  • python ../../mpisppy/generic_cylinders.py --module-name sizes --num-scens=3 --EF --EF-solver-name=gurobi_persistent — objective 224275.33
  • mpiexec -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 gap
  • ruff check examples/run_all.py
  • CI run_all / generic_tester jobs on this PR

🤖 Generated with Claude Code

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
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.74%. Comparing base (4bd0393) to head (e8ac5f8).
⚠️ Report is 1 commits behind head on main.

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.
📢 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.

@DLWoodruff DLWoodruff enabled auto-merge (squash) April 21, 2026 18:47
@DLWoodruff DLWoodruff merged commit 0b6d37e into Pyomo:main Apr 21, 2026
28 checks passed
@DLWoodruff DLWoodruff deleted the sizes_update branch April 21, 2026 18:56
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.

2 participants