Open
Conversation
This was referenced Mar 3, 2026
48a565d to
bd79668
Compare
bd79668 to
4367219
Compare
This PR adds the main Pyomo optimizer functions: lyopronto/pyomo_models/optimizers.py (2017 lines): - optimize_Tsh_pyomo(): Optimize shelf temperature trajectory - optimize_Pch_pyomo(): Optimize chamber pressure trajectory - optimize_Pch_Tsh_pyomo(): Optimize both pressure and temperature - Staged solving strategy for robustness - Warmstart from scipy solutions - Result formatting compatible with scipy outputs lyopronto/pyomo_models/__init__.py: - Export optimize_Tsh_pyomo, optimize_Pch_pyomo, optimize_Pch_Tsh_pyomo - Import guards for optional Pyomo dependencies API compatibility: - Same function signatures as scipy-based opt_*.py modules - Same output format (numpy array with 7 columns) - Drop-in replacement for scipy versions Tests (7 files): - test_optimizer_Tsh.py: Tsh optimization tests - test_optimizer_Pch.py: Pch optimization tests - test_optimizer_Pch_Tsh.py: Combined optimization tests - test_optimizer_framework.py: Framework tests - test_warmstart.py: Warmstart functionality - test_parameter_validation.py: Input validation - test_staged_solve.py: Staged solving strategy Usage: from lyopronto.pyomo_models import optimize_Tsh_pyomo result = optimize_Tsh_pyomo(vial, product, ht, Pchamber, Tshelf, dt, eq_cap, nVial)
4367219 to
f5b43a7
Compare
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
Top-level API matching scipy optimizer signatures:
pyomo_opt_Pch(),pyomo_opt_Tsh(),pyomo_opt_Pch_Tsh(). Accepts the same input dicts as scipy optimizers. Implements staged solving (single-step warmstart → full trajectory), multiple discretization methods, and ramp-rate constraints. Output format matches scipy (7-column numpy array).PR 5 of 7 in the Pyomo integration series.
Changes
lyopronto/pyomo_models/__init__.py— Updated public API exportslyopronto/pyomo_models/optimizers.py— Main optimizer API (2017 lines)tests/test_pyomo_models/test_optimizer_Pch.py— Pressure optimizer teststests/test_pyomo_models/test_optimizer_Pch_Tsh.py— Joint optimizer teststests/test_pyomo_models/test_optimizer_Tsh.py— Temperature optimizer teststests/test_pyomo_models/test_optimizer_framework.py— Framework teststests/test_pyomo_models/test_parameter_validation.py— Input validation teststests/test_pyomo_models/test_staged_solve.py— Staged solve teststests/test_pyomo_models/test_warmstart.py— Warmstart initialization testsKey Design Decisions
lyopronto.opt_Pch(scipy) andlyopronto.pyomo_models.optimizers.pyomo_opt_Pch(Pyomo) availablePR Chain
Testing
~2885 lines of new tests covering all three optimizer modes, framework validation, parameter handling, warmstart, and staged solving.