Skip to content

Conversation

@bernalde
Copy link
Member

@bernalde bernalde commented Feb 4, 2026

Summary

This PR syncs SECQUOIA/LyoPRONTO main with the upstream LyoHUB/LyoPRONTO repository.

Key Changes from Upstream

Physics Improvements

  • lyopronto/functions.py: Added RampInterpolator class for shelf temperature ramping
  • Improved lumped_cap_Tpr_abstract, lumped_cap_Tpr_ice, lumped_cap_Tpr_sol functions
  • Updated crystallization_time_FUN with Tsh_func parameter for dynamic shelf temperature
  • fill_output() now uses PCHIP interpolation for smoother results
  • Better dmdt<0 handling in calculators

Optimizer Robustness

  • lyopronto/opt_Pch.py: Improved error handling and bounds
  • lyopronto/opt_Tsh.py: Warning imports, ramp_rate handling
  • lyopronto/opt_Pch_Tsh.py: Code formatting improvements

Test Suite

  • Comprehensive test suite from upstream
  • New test files and reference data

CI/CD

  • Updated workflow configurations

Why This PR?

This establishes a clean foundation synced with upstream before adding Pyomo integration in subsequent PRs.

Part of Pyomo Integration Series

This is PR 0 of 8 in the Pyomo integration series:

  • PR 0 (this): Sync with upstream
  • PR 1: CI/CD infrastructure for Pyomo
  • PR 2: Pyomo dependencies and module structure
  • PR 3: Utils and single-step optimization
  • PR 4: Multi-period DAE model
  • PR 5: Optimizer functions
  • PR 6: Benchmarking infrastructure
  • PR 7: Documentation and examples

Ickaser and others added 3 commits December 19, 2025 12:15
To make LyoPRONTO an installable package, we need a pyproject.toml.

Since there have been a few improvements, I will publish a release and call it 1.1.
1) Add a test suite with comprehensive coverage
  * Run documentation notebooks as part of test suite, using papermill
2) Fix some problems uncovered by that test suite
  * Using fraction vs % in drying completion
  * Have calc_knownRp end when ramps end, per old API
  * Have calc_knownRp provide interpolated values at all time points, if dt!=None, per old API
  * Eliminate some infinite loops in design space calculation
  * Rework time handling for freezing 
3) Use pyproject.toml for everything possible
4) Build docs for PRs, but don't deploy because I couldn't get Actions runner correct permissions
5) Format the test suite with ruff
6) Introduce a RampInterpolation class, which is currently only used in freezing, testing, and calc_knownRp but could apply everywhere
7) Emit proper warnings, not just print to stdout
8) Add a dev section to docs

----
All commits:

* Add testing-related files from SECQUOIA fork

* Missed a file

* Have tests use pyproject.toml, not requirements.txt

* add pandas as dev dep

* fix tests: replace math.exp with np.exp

* fix: calc_knownRp uses percent rather than 0-1

* clean whitespace

* fix: Handle edge case in design space

* Move helper func to separate module under tests

* Fix tests for unknownRp

* Note that edge case needs treatment

* cleanup

* Include pytest settings in pyproject.toml

* Fully move all tests to percent dried, not fraction

* Further test cleanup

* Ignore some local things

* Standardize calc_unknownRp tests

* Fix a bug in design space, uncovered by tests

* DRY the tests out a bit

* Eliminate one cause of infinite loops in design space

* fix: give an initial guess in acceptable range

* Make a start on handling cases where optimization fails for Pch

* Get all tests passing, skip those that address problems which don't exist yet

* dry out Tsh a little bit

* Get all opt_Pch tests passing

* Get some Tsh tests passing

* Get joint optimization tests passing

* Remove separate "coverage" tests

* Complete line coverage of opt_Pch

* Unify Pch_Tsh optimization, with complete coverage

* default ramp rate of no ramp, if not supplied

* Add Tmax parameter to assert_physically_reasonable_output

* Tweak path handling

* Include results from web API in repo, for test comparisons

* Add coverage defaults to testing

* Rename for clarity, delete duplicate tests

* Consolidate calc_unknownRp into one file

* Make unknownRp give useful warnings, test those warnings

* lint

* Add warnings for design space, consolidate tests,, get complete test coverage

* Consolidate

* Consolidate and clarify knownRp tests

* clarify deps

* Get a proper regression test passing on calc_knownRp by taking dt and max time into account more carefully

* Work on increasing coverage

* Remove redundant test

* Make path to test data have one source of truth

* Standardize a magic number

* Test failures

* Add one more testing utility function

* Fix and clean up freezing, clean up tests, add tests to reach 100% coverage

* Make example scripts with plots part of the test suite

* Add tests which execute notebooks; rework CI to run papermill within pytest, rather than from papermill command line

* Fix compat bound

* fix: don't have notebooks run together with "PR tests"

* Separate out notebook dependencies from docs building dependencies

* Import papermill inside notebook tests

* Try out writing PR version of docs again

* try again pr docs

* one more thing to try

* move permissions?

* Give up on PR versions of docs from Actions

* Clean up unused config

* Make one category of dev deps, not two

* Remove unused testing script

* Delete obsolete test

* Modify equations being solved to account for varying shelf temperature during crystallization

* Add reference test for freezing

* Add new reference data for opt_Pch

* Point to correct file

* Test reference case for opt_Pch

* Give opt_pch reference case its own inputs setup

* Take some of Copilot's review suggestions

* Linting

* Ruff formatting. Lots of whitespace noise, all single quotes to double quotes

* Get *a* reference test working for opt_Pch

* unnecessary imports

* Relax tolerance

* Help diagnose CI failure

* Bite the bullet and add a time interpolator for Tshelf and Pchamber

* Make RampInterpolator conform to existing API for dt_setpt, with kwarg for changing to other interpretation

* Add more consistency checks to optimization tests, use some np.testing utilities

* Fix freezing reference to be closer to original interpretation

* Get one last test passing

* ruff format on tests

* Remove unused sections from pyproject.toml

* Make some dev docs, shuffle things into there from README, etc.

* Add some extra helpers for RampInterpolator, use in calc_knownRp
This PR syncs SECQUOIA/LyoPRONTO main with the upstream LyoHUB/LyoPRONTO repository.

Key changes from upstream:
- lyopronto/functions.py: RampInterpolator class, improved lumped_cap_Tpr functions
- lyopronto/calc_*.py: Better error handling, PCHIP interpolation
- lyopronto/opt_*.py: Improved optimizer robustness
- tests/: Comprehensive test suite from upstream
- CI: Updated workflow configurations

This establishes a clean foundation for adding Pyomo integration.
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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