Skip to content

Fix swapped rectifier/stripper platform-and-ladders cost labels in divided columns - #252

Merged
yoelcortes merged 1 commit into
masterfrom
fix-divided-column-platform-labels
Aug 22, 2026
Merged

Fix swapped rectifier/stripper platform-and-ladders cost labels in divided columns#252
yoelcortes merged 1 commit into
masterfrom
fix-divided-column-platform-labels

Conversation

@sarangbhagwat

Copy link
Copy Markdown
Member

Title: Fix swapped rectifier/stripper platform-and-ladders cost labels in divided columns

Branch: fix-divided-column-platform-labelsmaster

Fixes #251.

In Distillation._cost, the is_divided=True branch assigned the platform-and-ladders cost computed from the rectifier dimensions to 'Stripper platform and ladders' and the one from the stripper dimensions to 'Rectifier platform and ladders'. This PR swaps the two keys so each section's cost is computed from its own diameter and height.

  • Two-line change in biosteam/units/distillation.py; no change to totals (both keys have F_BM = 1), only to the per-section labels.
  • Verified on a divided BinaryDistillation column: Cost['<section> platform and ladders'] now equals compute_plaform_ladder_cost(Design['<section> diameter'], Design['<section> height']) for both sections.
-            Cost['Stripper platform and ladders'] = design.compute_plaform_ladder_cost(Di_R, H_R)
+            Cost['Rectifier platform and ladders'] = design.compute_plaform_ladder_cost(Di_R, H_R)
             W_S = Design['Stripper weight'] # in lb
             H_S = Design['Stripper height'] # in ft
             Cost['Stripper tower'] = design.compute_empty_tower_cost(W_S)
-            Cost['Rectifier platform and ladders'] = design.compute_plaform_ladder_cost(Di_S, H_S)
+            Cost['Stripper platform and ladders'] = design.compute_plaform_ladder_cost(Di_S, H_S)

…vided Distillation columns

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@yoelcortes yoelcortes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another good catch!

@yoelcortes
yoelcortes merged commit 1aef1ee into master Aug 22, 2026
1 of 3 checks passed
sarangbhagwat added a commit that referenced this pull request Sep 4, 2026
…review

The PR #257 review asked to drop the PEP 562 module __getattr__ shims that
re-exported HeatExchangerNetwork from hensmith: they add a layer of
indirection that is unnecessary because hensmith is quick to import.

biosteam/__init__.py now ends with a plain `import hensmith`, after every
biosteam subpackage hensmith needs (it subclasses Facility) is
initialized, and lists 'HeatExchangerNetwork' in __all__ only when that
import succeeds. Only a missing hensmith (ModuleNotFoundError naming
hensmith) is tolerated, so biosteam still imports in environments
without it; an error raised while hensmith itself initializes propagates
instead of being masked. The binding of the name is done by hensmith,
not here: in the hensmith-first import order biosteam's __init__ runs
from hensmith's own `import biosteam` while hensmith is still
initializing and HeatExchangerNetwork does not exist yet, so a
`from hensmith import HeatExchangerNetwork` in biosteam would raise
ImportError in that order. hensmith 0.1.2 therefore binds
HeatExchangerNetwork into biosteam and biosteam.facilities at the end of
its own __init__ -- whichever package finishes initializing second does
the binding -- and setup.py pins hensmith>=0.1.2 since 0.1.1 (on PyPI)
would leave the name unbound. The name stays out of facilities.__all__,
which biosteam star-imports before hensmith can bind it.

The __getattr__/__dir__ shims and the deprecated aliases for the
synthesis helpers (StreamLifeCycle, ProblemTable, problem_table,
synthesize_network, plot_pinch_diagram) are removed; those live in
hensmith only (no downstream user in biorefineries). create_all_facilities
already used bst.HeatExchangerNetwork with a module-scope import.

tests/test_hensmith_integration.py is rewritten for the eager contract:
both import orders, star-import from scratch, missing hensmith (name
absent from the namespace and from __all__), broken hensmith propagating,
the facilities.__all__ guard, and the create_all_facilities smoke test
(7 passed). hensmith suite: 33 passed. Full suite (CI invocation, with
thermosteam at f768d38 as master's submodule pointer requires): 82 failed,
462 passed, 62 skipped -- versus the recorded 74-failure baseline, 15
fewer notebook failures and 23 new doctest failures that are stack drift
in the merged master (21 single-component Stream.show representation
from thermosteam 68e89dc; BinaryDistillation and ShortcutColumn
platform-and-ladders labels not regenerated after #252), none involving
hensmith.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

Rectifier/stripper "platform and ladders" cost labels are swapped for divided distillation columns

2 participants