Skip to content

regenerate the HeatExchangerNetwork doctest for thermosteam's new activity model; bump to 0.2.0 - #4

Merged
sarangbhagwat merged 2 commits into
masterfrom
fix-doctest-activity-model-drift
Dec 2, 2026
Merged

sarangbhagwat merged 2 commits into
masterfrom
fix-doctest-activity-model-drift

Conversation

@sarangbhagwat

@sarangbhagwat sarangbhagwat commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

What was wrong

The master build has been red since it was re-run on 2026-10-21, with no change in hensmith. CI installs thermosteam and biosteam from git HEAD, and two upstream changes reached the suite:

  1. biosteam 2dd9b4dc made the fuel (natural_gas) heat utility flash its flue gas. At the flue's bubble point the Rachford-Rice objective in thermosteam divided by zero, which raises only with numba disabled (as CI runs). thermosteam 4f7eab4c has since fixed this case upstream, so nothing in hensmith changes for it.
  2. thermosteam changed its default activity-coefficient model (Dortmund to modified UNIFAC). This is what still fails on master today: the HeatExchangerNetwork class doctest prints stream enthalpies that depend on it.

Why the numbers moved

The example's column D1 separates methanol and water. With the new activity model its minimum reflux rises from 13.04 to 13.98 (+7.2 %), so its condenser duty goes from -1.794e7 to -1.922e7 kJ/hr and its reboiler duty from 6.723e7 to 6.859e7 kJ/hr. Everything else in the example is unchanged: the same streams, the same matches, the same network, still at MER.

The fix

Regenerate the doctest's stream life cycle enthalpies by re-running the example and pasting its output. No library code changes, and no other doctest or test output changes.

Validation

Full suite, as CI runs it (pytest . --disable-numba=1), against biosteam 07ddb417 (2.55.5) and thermosteam 49fc5160 (0.55.5): 958 passed.

Version

Bumps hensmith to 0.2.0 (hensmith/__init__.py and setup.py). master has gained the MER synthesizer rewrite (#1) and stream splitting (#2) since 0.1.2 was released, so its networks and their costs differ from that release; a minor version says so. The citation still names v0.1.2, the release its Zenodo record is of. Nothing is tagged or published by this pull request.

Relation to #3

dev carries the same doctest commit (cherry-picked), so the two can merge in either order; dev does not carry the version bump, and will need its own once this is merged.

🤖 Generated with Claude Code

…m's new default activity model

CI went red on master without a hensmith change. The first cause was
upstream and is gone: biosteam 2dd9b4dc (2026-10-08) made the fuel heat
utility run a PH flash on its flue gas, whose bubble point (79.4 K) gives
water a K of 8.2e-25, and thermosteam's Rachford-Rice objective then divided
by exactly zero at a phase fraction of 1 (raised only with numba disabled, as
CI runs; with numba the jitted division returns inf). thermosteam 4f7eab4c
(2026-11-05) moves components with K <= 1e-24 to the non-volatile fraction,
so that case passes again. (K in (1e-24, ~5.5e-17) still raises there
without numba; left to thermosteam.)

What remains against today's upstream (biosteam 07ddb417, thermosteam
49fc5160, 0.55.5) is one doctest: the stream life cycles printed in the
HeatExchangerNetwork class docstring. 957 passed, 1 failed before this
commit.

Cause: thermosteam's default activity coefficient model changed from
DortmundActivityCoefficients to ModifiedUNIFACActivityCoefficients. The pure
component properties of water, methanol and glycerol are unchanged (Hvap, Tb,
Psat and Cn agree to the printed digits), but the minimum reflux of the
example's ShortcutColumn D1 rises from 13.04 to 13.98 (+7.2 %), and with
k=2 so does its reflux: the condenser duty goes from -1.794e7 to -1.922e7
kJ/hr and the reboiler duty from 6.723e7 to 6.859e7 kJ/hr. The duties of
D1_H1, D1_H2 and F1 and all temperatures are identical on both stacks
(compared on biosteam a258953a + thermosteam 5a473e9b against the current
clones).

The network is the same one: same matches and exchanger IDs, status 'mer',
utility load ratio 0.8248 -> 0.8217 (0.82 as printed, unchanged), energy
balance error 1e-11 %. Only the printed enthalpies of streams 0 to 3 move,
by 2 to 7 %. This is an intended doctest output change, regenerated by
running the example on the current stack and pasting; no hensmith behavior
changes.

Validation: pytest . --disable-numba=1 -q -p no:cacheprovider, 958 passed.

Not updated here: the tutorial pages and docs/source/_generated outputs show
the same example with the old numbers (they are built by
docs/_demo_src/build_all.py and are not run by the suite).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@read-the-docs-community

read-the-docs-community Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · hensmith · built Dec. 2, 2026, 4:41 a.m. UTC

master has gained the MER synthesizer rewrite (#1) and stream splitting
(#2, the new stream_splitting option) since 0.1.2 was released and
tagged on 2026-09-04: the networks it synthesizes, and so their utility
loads and costs, differ from those of 0.1.2. A minor version says so; a
patch number would present the next release as a drop-in fix.

Both places that record the version move together (hensmith/__init__.py
and setup.py; the docs read hensmith.__version__). The citation in the
README and the docs still names v0.1.2, the release its Zenodo record is
of. biosteam requires hensmith>=0.1.2, which 0.2.0 satisfies.

Full suite: 958 passed (pytest . --disable-numba=1) against biosteam
07ddb417 and thermosteam 49fc5160.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sarangbhagwat sarangbhagwat changed the title regenerate the HeatExchangerNetwork doctest for thermosteam's new default activity model regenerate the HeatExchangerNetwork doctest for thermosteam's new activity model; bump to 0.2.0 Dec 2, 2026
@sarangbhagwat
sarangbhagwat merged commit 98f1075 into master Dec 2, 2026
3 checks passed
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