Skip to content

Release 1.6.0 - #49

Merged
jowr merged 4 commits into
masterfrom
chp/epic-planck-xv40zq
Nov 12, 2026
Merged

jowr merged 4 commits into
masterfrom
chp/epic-planck-xv40zq

Conversation

@jowr

@jowr jowr commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Release 1.6.0, with two fixes:

This was planned as 1.5.2. The new path kind is a change of the public API, so it is a minor release.

Version 1.6.0

Envelope crossings: why

The conda-forge build of 1.5.1 (conda-forge/staged-recipes#35603) failed one test on macOS only: test_blend_lines_meet_the_dome_near_the_critical_point.

Where an isoline of a mixture crosses the phase envelope, CoolPlot first tries the exact saturation flash. Near the critical point that flash often does not converge, and the crossing was then interpolated on a straight line between two envelope points. There the points are up to 4 K apart and the dome bends, so the straight line is off by up to 2e-3 in pressure.

For R32/R125 at 340 K, 4 K below the critical point:

  • On linux the bubble flash just fails, so the line got the straight-line value. The test compared that with the same straight line and passed.
  • On macOS the flash just converges and gives the exact state. That is about 2e-4 from the straight-line reference, and the test allows 1e-4, so it failed.

The macOS result is the correct one; the reference was not.

Envelope crossings: changes

  • isolines._envelope_crossings:
    • the crossing is a cubic through the four envelope points around it, with the isoline quantity as the variable
    • it falls back to the straight line where that quantity turns over the four points, where the steps differ by more than 100 to 1, or where the cubic strays further from the straight line than the step between the two points
    • CoolProp repeats some envelope points where its pieces join, sometimes differing only in the last digits; these are taken once. Without that, the cubic through two nearly equal points produced nonsense in testing.
  • Docstrings state the accuracy that was measured.
  • Tests:
    • the isotherm test compares against a cubic fitted to the envelope below its top. Past the top, the envelope comes back to 340 K at about 10 MPa.
    • a new test, test_envelope_crossings_follow_the_curved_dome, checks a crossing against the exact flash at 339 K, where it converges.
    • both fail with the old code and pass with the new.

Accuracy

Measured against the exact flash, over isotherms and isobars of R32/R125, R32/R1234yf and R32/R1234ze(E):

straight line (1.5.1) cubic (1.6.0)
pressure, R32/R125 up to 2.1e-3 up to 1.2e-6
pressure, R32/R1234yf up to 2.6e-3 up to 1.1e-4 (at the top of the dome)
enthalpy up to 1.5e-3 up to 4e-4
  • The new method was worse in 2 of 2542 values, at most 1.1e-4, right at the top of a dome where the curve bends hardest. That is far below a line width.
  • Every isoline finds the same number of crossings as before.

CoolProp's C++ port

envelope_crossings in CoolProp's src/CoolPropPlot.cpp (the port in CoolProp.CoolProp.Plot) still interpolates linearly. It needs the same change before both copies give the same points. It is in no released CoolProp wheel yet (8.0.0 has none), so nothing breaks in the meantime.

Testing

  • Envelope crossings, before the merge: full suite with the slow sweeps (--run-slow), CoolProp 8.0.0, Python 3.13: 624 passed, 97 skipped (browser and Kaleido tests). mypy as configured in pyproject.toml: no issues.
  • After the merge and the version change, locally: tests/test_numerics.py (22 passed), the path tests of tests/test_cycles.py, and test_api_vocabulary, test_branding, test_dome_labels, test_marked_points, test_saturation_scale, test_contracts, test_thermo (113 passed). CI runs the full suite.

After merging

Tag the merge commit v1.6.0. The staged-recipes PR then moves to 1.6.0.

Where an isoline of a mixture crosses the phase envelope and CoolProp's
saturation flash does not converge, the crossing was interpolated on a
straight line between two envelope points. Near the critical point,
where the points are up to 4 K apart and the dome bends, that is off by
up to 2e-3 in pressure. Whether the flash converges there differs
between platforms: on macOS the bubble flash of R32/R125 converges at
340 K and gives the exact state, which failed
test_blend_lines_meet_the_dome_near_the_critical_point against its
straight-line reference (conda-forge staged-recipes build).

- the crossing is a cubic through the four envelope points around it,
  with the isoline quantity as the variable; a straight line where that
  quantity turns over the four points, where the steps are uneven by
  more than 100 to 1, or where the cubic strays from the straight line
- the envelope's repeated points (CoolProp repeats some where its
  pieces join, sometimes differing in the last digits) are taken once
- against the exact flash, over isotherms and isobars of R32/R125,
  R32/R1234yf and R32/R1234ze(E): pressure within 1.2e-6 (R32/R125)
  and 1.1e-4 (R32/R1234yf, at the top of the dome) instead of 2.6e-3,
  enthalpy within 4e-4 instead of 1.5e-3; worse than before in 2 of
  2542 values, by at most 1.1e-4, at the top of the dome
- the test compares with a cubic reference below the top of the
  envelope; a new test checks a crossing against the exact flash at
  339 K. Both fail with the straight line.

CoolProp's C++ port of these numerics (envelope_crossings in
src/CoolPropPlot.cpp) still interpolates linearly and needs the same
change to give the same points.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013bsHH7N2gNABwvNHsDaKn9
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The release updates the package to version 1.5.2. Mixture-isoline envelope crossings now remove repeated points and use guarded cubic interpolation, with linear interpolation retained when the cubic checks fail. Tests compare dome and crossing results with fitted or CoolProp values.

Changes: Mixture Isoline Crossings

Layer / File(s) Summary
Deduplicate envelope points and interpolate crossings
src/coolplot/thermo/isolines.py
The crossing calculation removes repeated envelope points. It uses cubic interpolation when the four-point stencil passes monotonicity, spacing, finite-value, and deviation checks. Otherwise, it retains linear interpolation.
Validate crossings and record release
tests/test_numerics.py, CHANGELOG.md, src/coolplot/__version__.py
Tests check the 340 K dome pressure and compare the 339 K bubble crossing with a CoolProp QT flash. The changelog and package version record release 1.5.2.
Merge Risk: Minimal · up to 13cde

This release changes how mixture isoline crossings near the phase envelope are interpolated, with a fallback to the previous straight-line method when the cubic looks unreliable. No actionable merge-blocking risk was found. The reported test results were not independently re-run.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Title check Warning The title "Release 1.6.0" does not match the changeset. The changes set the version to 1.5.2, add a 1.5.2 changelog entry, and change cubic interpolation in isolines._envelope_crossings. The title nam… Change the title to describe the main change, for example "Use cubic interpolation for mixture isoline crossings near phase envelope" or "Release 1.5.2" if the release label is the goal. The version in the title must match the version in sr…
Passed Passed checks: 3 passed

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "Release 1.6.0" does not match the changeset. The changes set the version to 1.5.2, add a 1.5.2 changelog entry, and change cubic interpolation in isolines._envelope_crossings. The title names a different version and omits the main change. It is vague and misleading about the content.

Resolution

Change the title to describe the main change, for example "Use cubic interpolation for mixture isoline crossings near phase envelope" or "Release 1.5.2" if the release label is the goal. The version in the title must match the version in src/coolplot/version.py.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the curves at play,
Four points guide the crossing’s way.
If cubic steps stay smooth and true,
It follows them; else lines come through.
The release notes mark one-five-two,
And tests compare the values too.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7784e8f1-57af-4565-b995-6b5190390e01
Commits

Reviewing files that changed from the base of the PR and between 6ef0186 and 13cdeef.

Files selected for processing: 4

  • CHANGELOG.md
  • src/coolplot/__version__.py
  • src/coolplot/thermo/isolines.py
  • tests/test_numerics.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

jowr and others added 3 commits November 12, 2026 12:46
…in 1.5.2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013bsHH8qQUqPxK3TzHzpc72
The release adds a path kind ("isochoric"), a change of the public API,
so it is a minor release. The upgrade guide gets a section from 1.5 to
1.6. Notes that still said the features of 1.5.0 came with 1.6 (dome
labels, the saturation scale, the marked points, the versions line) say
1.5, as the rest of the code and the changelog do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013bsHH8qQUqPxK3TzHzpc72
@jowr jowr changed the title Release 1.5.2 Release 1.6.0 Nov 12, 2026
@jowr
jowr merged commit e6b3067 into master Nov 12, 2026
10 checks passed
@jowr
jowr deleted the chp/epic-planck-xv40zq branch November 12, 2026 13:19
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.

1 participant