Skip to content

Commit

Permalink
fix bug for biosteam units without results
Browse files Browse the repository at this point in the history
  • Loading branch information
yalinli2 committed Oct 24, 2024
1 parent 117de0f commit 066f42f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qsdsan/_sanunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ def results(self, with_units=True, include_utilities=True,
include_total_cost=True, include_installed_cost=False,
include_zeros=True, external_utilities=(), key_hook=None):

if super().results is None: return super().results
results = super().results(with_units, include_utilities,
include_total_cost, include_installed_cost,
include_zeros, external_utilities, key_hook)
Expand All @@ -647,7 +648,7 @@ def results(self, with_units=True, include_utilities=True,
results.insert(0, 'Units', '')
results.loc[(k, ''), :] = ('USD/hr', v)
results.columns.name = type(self).__name__
if with_units:
if with_units and results is not None:
results.replace({'USD': f'{currency}', 'USD/hr': f'{currency}/hr'},
inplace=True)
return results
Expand Down

0 comments on commit 066f42f

Please sign in to comment.