PR 3/7: Pyomo utilities and single-step optimization#8
Open
bernalde wants to merge 1 commit intopr/pyomo-dependenciesfrom
Open
PR 3/7: Pyomo utilities and single-step optimization#8bernalde wants to merge 1 commit intopr/pyomo-dependenciesfrom
bernalde wants to merge 1 commit intopr/pyomo-dependenciesfrom
Conversation
This was referenced Mar 3, 2026
fa26a34 to
65fc2c3
Compare
6fa03b3 to
58d26cd
Compare
65fc2c3 to
b8a82c3
Compare
bernalde
added a commit
that referenced
this pull request
Mar 3, 2026
pytest -m 'pyomo' exits with code 5 when no pyomo-marked tests exist. This is expected until PR #8 adds the first pyomo tests. Treat exit code 5 as success so the Pyomo Tests job passes gracefully.
58d26cd to
72e8b86
Compare
b8a82c3 to
53ad6d9
Compare
This PR adds the foundational Pyomo modules: lyopronto/pyomo_models/utils.py (254 lines): - Warmstart utilities for initializing from scipy solutions - Variable scaling functions for numerical stability - Validation helpers for checking physical constraints - Result extraction and formatting utilities lyopronto/pyomo_models/single_step.py (427 lines): - Single time-point optimization formulation - Direct Pyomo model for one drying step - Basis for multi-period trajectory optimization - Physics constraints as Pyomo constraints Tests: - tests/test_pyomo_models/test_model_single_step.py - tests/test_pyomo_models/README.md These utilities are used by the multi-period model (PR 4) and the optimizer functions (PR 5).
72e8b86 to
9b54119
Compare
53ad6d9 to
389c49e
Compare
bernalde
added a commit
that referenced
this pull request
Mar 16, 2026
Source fixes: - calc_knownRp.py: use constant.Torr_to_mTorr instead of literal 1000.0 in early-return path, with regression test Test fixes: - Fix percent-dried scale bug: 0.99 -> 99.0 across test_regression.py (5), test_optimizer.py (1), test_opt_Pch_Tsh_coverage.py (2+2), test_opt_Pch_coverage.py (2) - test_coverage_gaps.py: remove duplicate TestIneqConstraints class - test_functions.py: add value assertions to TestIneqConstraints - test_regression.py: skip column 0 (time) in stability test - test_calculators.py: add meaningful assertion in test_higher_pressure_dries_faster - test_web_interface.py, test_calc_unknownRp_coverage.py: use reference_data_path fixture instead of relative paths - test_calc_knownRp.py: add regression test for mTorr conversion Config fixes: - pyproject.toml: remove duplicate [tool.pytest.ini_options] (pytest.ini takes precedence) - pytest.ini: update minversion from 3.8 to 7.4 - requirements-dev.txt: add pytest-mock (matches pyproject.toml [dev]) CI fixes: - pr-tests.yml, tests.yml, slow-tests.yml: consolidate triple pip install into single pip install -e ".[dev]" - Remove hardcoded PR #8 reference from pyomo fallback messages Script fixes: - run_local_ci.sh: remove emojis, replace grep -oP with portable -oE, remove set -e/dead-code if-block, remove hardcoded -n 8, use pip install -e ".[dev]" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Core Pyomo building blocks.
utils.pyprovides parameter conversion from LyoPRONTO dicts to Pyomo-compatible formats, variable bound defaults, and warmstart helpers.single_step.pyimplements a single time-step steady-state optimization (one NLP solve per step), mirroring the scipy optimizer's step-by-step approach.PR 3 of 7 in the Pyomo integration series.
Changes
lyopronto/pyomo_models/utils.py— Shared utilities (variable bounds, parameter loading, warmstart)lyopronto/pyomo_models/single_step.py— Single time-step Pyomo modeltests/test_pyomo_models/test_model_single_step.py— 307 lines of teststests/test_pyomo_models/README.md— Test documentationKey Design Decisions
Pch(0.05–0.5 Torr),Tsh(-50–50°C),Tsub(-60–0°C)exp()PR Chain
Testing
~307 lines of new tests covering single-step model creation, solving, and parameter validation.