Fix swapped rectifier/stripper platform-and-ladders cost labels in divided columns - #252
Merged
Merged
Conversation
…vided Distillation columns Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
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.
Title: Fix swapped rectifier/stripper platform-and-ladders cost labels in divided columns
Branch:
fix-divided-column-platform-labels→masterFixes #251.
In
Distillation._cost, theis_divided=Truebranch 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.biosteam/units/distillation.py; no change to totals (both keys haveF_BM = 1), only to the per-section labels.BinaryDistillationcolumn:Cost['<section> platform and ladders']now equalscompute_plaform_ladder_cost(Design['<section> diameter'], Design['<section> height'])for both sections.