Skip to content

Commit

Permalink
0.49.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelcortes committed Dec 21, 2024
1 parent bea8c7d commit b55ac78
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name='thermosteam',
packages=['thermosteam'],
license='MIT',
version='0.49.1',
version='0.49.2',
description="BioSTEAM's Premier Thermodynamic Engine",
long_description=open('README.rst', encoding='utf-8').read(),
author='Yoel Cortes-Pena',
Expand Down
2 changes: 1 addition & 1 deletion thermosteam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# update_module(chemicals, numba)
# use_numba_chemicals()
# del use_numba_chemicals
__version__ = "0.49.1"
__version__ = "0.49.2"

from . import thermo
del thermo
Expand Down
21 changes: 21 additions & 0 deletions thermosteam/_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,27 @@ def scale(self, scale):
self._imol.data *= scale
rescale = scale

def reset(self, T=None, P=None, **flows):
"""
Convinience method for resetting flow rate and thermal condition data.
Examples
--------
>>> import thermosteam as tmo
>>> tmo.settings.set_thermo(['Water', 'Ethanol'], cache=True)
>>> s1 = tmo.Stream('s1', Water=1)
>>> s1.reset(T=300.1, Ethanol=1, phase='g', units='kg/hr', total_flow=2)
>>> s1.show('cwt')
Stream: s1
phase: 'g', T: 300.1 K, P: 101325 Pa
composition (%): Ethanol 100
------- 2 kg/hr
"""
self.reset_flow(**flows)
if T is not None: self.T = T
if P is not None: self.P = P

def reset_flow(self, phase=None, units=None, total_flow=None, **chemical_flows):
"""
Convinience method for resetting flow rate data.
Expand Down
5 changes: 4 additions & 1 deletion thermosteam/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,10 @@ def unmark_disjunction(stream):
disjunctions.remove(port)

def feed_complexity(stream):
return stream.F_mass * (stream.mol != 0).sum()** 2
if hasattr(stream, 'mol'):
return stream.F_mass * (stream.mol != 0).sum()** 2
else:
return stream.F_mass

def sort_feeds_big_to_small(feeds):
if feeds:
Expand Down

0 comments on commit b55ac78

Please sign in to comment.