Skip to content

Fix numeric System.results output without units - #264

Merged
yoelcortes merged 1 commit into
BioSTEAMDevelopmentGroup:masterfrom
sixty-66:fix/system-results-without-units
Nov 20, 2026
Merged

yoelcortes merged 1 commit into
BioSTEAMDevelopmentGroup:masterfrom
sixty-66:fix/system-results-without-units

Conversation

@sixty-66

@sixty-66 sixty-66 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

System.results(with_units=False) raises AttributeError because it calls get_inlet_utility_flows() and get_outlet_utility_flows(), which are no longer defined. Use get_inlet_cost_flows() and get_outlet_revenue_flows(), matching the branch that includes units.

The regression tests compare the numeric Series with the DataFrame's numeric column, both with and without custom stream fees and credits. They also check inlet costs and negative outlet credits. The method docstring now describes both return formats.

Validation on Windows / Python 3.12.12:

  • Both new parameter cases fail against the original implementation with the missing-method error.
  • python -m pytest tests/test_report.py -q -o addopts= --basetemp=<external-temp-directory>: 9 passed.
  • The same report tests with --cov=biosteam also pass; both corrected calls are covered.
  • git diff --check passes.
  • The default non-slow suite stops during collection in docs/conf.py: the installed sphinx_autodoc_typehints has no format_annotation attribute.
  • A broader run targeting biosteam tests passes 31 cases before a GibbsEquilibriumReactor output-format doctest fails. A separate unit-test run passes 6 cases before test_jacketed_bubble_column fails on reactor volume. Both failures reproduce with the original _system.py; complete-suite validation remains pending.

Following the PR template, this is a draft while the complete test requirement is pending.

  • Clear contribution
  • Documentation
  • Tests — report tests pass; full-suite validation is pending.
  • Code coverage — the regression cases exercise both corrected calls and their flow/cost rows.

Use cost and revenue flow getters in the numeric results path to avoid calls to removed utility-flow methods.

@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.

Looks good, thanks for the update!

@yoelcortes

Copy link
Copy Markdown
Member

The other tests (which are unrelated) will be fixed with an upcoming PR.

@yoelcortes
yoelcortes marked this pull request as ready for review November 20, 2026 06:10
@yoelcortes
yoelcortes merged commit 5bd5d11 into BioSTEAMDevelopmentGroup:master Nov 20, 2026
0 of 2 checks passed
@sixty-66
sixty-66 deleted the fix/system-results-without-units branch November 20, 2026 06:16
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