BioSTEAMDevelopmentGroup / thermosteam

BioSTEAM's Premier Thermodynamic Engine
Other
57 stars 12 forks source link

fix bug with unlinking multistreams #89

Closed yoelcortes closed 1 year ago

yoelcortes commented 1 year ago

@sarangbhagwat,

Thanks for letting me know about the bug with unlinking multistreams! This pull fixes it and adds a doctest.

>>> import thermosteam as tmo
>>> tmo.settings.set_thermo(['Water', 'Ethanol'], cache=True)
>>> s1 = tmo.Stream('s1', Water=20, Ethanol=10, units='kg/hr')
>>> s2 = tmo.Stream('s2')
>>> s1.phases = s2.phases = ('l', 'g')
>>> s2.link_with(s1)
>>> s1.imol.data is s2.imol.data
True
>>> s1.unlink()
>>> s1.imol.data is s2.imol.data
False

Thanks!

sarangbhagwat commented 1 year ago

Looks good to me. Thanks for the fix!