Open
Conversation
This PR adds the CI/CD infrastructure to support Pyomo tests alongside scipy tests. Key changes: - .github/workflows/tests.yml: Add separate test-scipy and test-pyomo jobs - .github/workflows/pr-tests.yml: Add Pyomo tests with continue-on-error - .github/workflows/slow-tests.yml: Add include_pyomo option - pytest.ini: Add 'pyomo' and 'notebook' markers The Pyomo tests: - Install pyomo and idaes-pse from [optimization] extras - Install IPOPT solver via 'idaes get-extensions --extra petsc' - Run with continue-on-error: true (don't block PRs/merges) - Use marker: @pytest.mark.pyomo This enables running Pyomo tests independently while not blocking scipy-based workflows.
This was referenced Mar 3, 2026
Fix two bugs in RampInterpolator.__init__() (LyoHUB#17): 1. No-init path double-counting: When rampspec lacks an 'init' key, dt_setpt[0] was consumed both during initialization (times starts with [0, dt_setpt[0]]) and in the loop at i=1 (via i-1=0 index). Fix: use dt_idx=i (not i-1) in the no-init path so the loop starts consuming at dt_setpt[1]. 2. Negative holdtime: When ramp time exceeds total stage time, holdtime goes negative, producing non-monotonic cumulative times. The warning condition was also wrong (ramptime > holdtime instead of holdtime < 0). Fix: clamp holdtime to 0 and improve the warning message. Add regression tests for both bugs.
There was a problem hiding this comment.
Pull request overview
Updates CI workflows to support running Pyomo-related tests separately from the SciPy/core test suite, and registers new pytest markers to enable selective execution. Despite the PR description indicating “CI/CD only”, it also includes a functional fix and regression tests for RampInterpolator.
Changes:
- Split CI test execution into SciPy/core vs Pyomo-marked tests across PR, main, and manual slow-test workflows.
- Register additional pytest markers (
serial,pyomo,notebook) and enable--dist loadgroupfor xdist. - Fix
RampInterpolatortime accounting (no-init multi-setpoint double-count) and clamp negative hold times; add regression tests for both.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/pr-tests.yml |
Adds separate optional Pyomo job and excludes pyomo tests from SciPy PR runs. |
.github/workflows/tests.yml |
Splits main-branch CI into SciPy vs optional Pyomo jobs with separate coverage uploads. |
.github/workflows/slow-tests.yml |
Adds a manual toggle to include/exclude Pyomo tests and IPOPT setup. |
pytest.ini |
Registers new markers and adds --dist loadgroup to default pytest options. |
lyopronto/functions.py |
Fixes RampInterpolator scheduling logic and clamps negative hold times with a warning. |
tests/test_functions.py |
Adds regression tests for the RampInterpolator fixes. |
- Replace pip install .[optimization] with explicit pip install pyomo idaes-pse in all three CI workflows (pr-tests.yml, tests.yml, slow-tests.yml). The optimization extra is not defined until PR 2, so the Pyomo jobs need to install deps explicitly for now. - Fix misleading 'strictly monotonic' comment in test assertions to say 'monotonically non-decreasing' (holdtime can be clamped to 0).
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.
…rker - Add 'if: draft == false' to test-pyomo job in pr-tests.yml so draft PRs get fast feedback without installing Pyomo/IDAES/IPOPT. - Update serial marker description to clarify it requires manual enforcement via 'pytest -m serial -n 0'.
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
Updates CI workflows to handle Pyomo as an optional dependency. Tests are split into core (always run) and pyomo (only when Pyomo is installed). Adds
@pytest.mark.pyomomarker registration.Also includes a bugfix for
RampInterpolator(fixes LyoHUB/LyoPRONTO#17).PR 1 of 7 in the Pyomo integration series. See the full plan in PR #5.
Changes
CI/CD
.github/workflows/pr-tests.yml— Add Pyomo-aware test splits (separatetest-scipyandtest-pyomojobs); install Pyomo deps explicitly (not via[optimization]extra, which is defined in PR PR 2/7: Pyomo optional dependencies and module structure #7).github/workflows/slow-tests.yml— Pyomo slow test support with explicit dep install.github/workflows/tests.yml— Full test workflow with Pyomo; removedev-pyomobranch trigger (replaced by PR chain)pytest.ini— Addserial,pyomo,notebookmarkersBug Fix (LyoHUB#17)
lyopronto/functions.py— FixRampInterpolator.__init__(): (1) prevent double-counting ofdt_setpt[0]in the no-init path, (2) clamp negative holdtime to 0 instead of silently producing incorrect schedulestests/test_functions.py— Add two regression tests for the RampInterpolator fix; fix assertion comments ("monotonically non-decreasing" to match>= 0check)PR Chain
Testing
pip install pyomo idaes-pse(the[optimization]extra is not defined until PR PR 2/7: Pyomo optional dependencies and module structure #7)