BioSTEAMDevelopmentGroup / thermosteam

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

Fix chemical iupac setting #79

Closed yalinli2 closed 1 year ago

yalinli2 commented 1 year ago

Hi @yoelcortes , the recent commit 4312066d9b4862bf4385f82a5187af2a4e1cb596 broke things for customized chemicals without a default iupac_name, where the iupac_name setter converts all the values to a str regardless (even if it's an empty tuple) https://github.com/BioSTEAMDevelopmentGroup/thermosteam/blob/e3d4bcda09ebeb4796065595276b42fd32c8b3ac/thermosteam/_chemical.py#L932

but when compiling chemicals, iupac_name is set to a tuple, so the next time iupac_name is called, it becomes ('()',), and this creates problems downstream (apparently led to infinite loop somewhere in qsdsan's systems, code 137 means github killed it as it was taking huge memory)

not exactly sure how you wanted to fix it, but I changed the iupac_name setter from python self._iupac_name = str(iupac_name) to python self._iupac_name = str(iupac_name) if iupac_name else ()

and it works.

the rest changes are just typo-fixing as I noticed them, thanks!

yoelcortes commented 1 year ago

Awesome, thanks!

yalinli2 commented 1 year ago

Thanks @yoelcortes , can you update the thermosteam commit ref in biosteam so that it can point to the latest thermosteam (or let me how if I can do it?), otherwise qsdsan's tests probably won't pass, thanks!