BioSTEAMDevelopmentGroup / thermosteam

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

Avoid `x not in list` error in reloading #43

Closed yalinli2 closed 2 years ago

yalinli2 commented 2 years ago

For lines 47-49 (not sure if it's my environment or other users get the same problem as well) https://github.com/BioSTEAMDevelopmentGroup/thermosteam/blob/1eb92fda7023fd075f51c6234f1ca2d8ccb53308/thermosteam/thermo/tp_dependent_property.py#L47

I often get the this error (since I use auto-reload):

Screen Shot 2021-09-09 at 9 39 25 PM

Can we change these to something similar to (or better solutions) so that auto-reloading would work?

for i in (
    VolumeLiquid.ranked_methods,
    VolumeLiquid.ranked_methods_P,
    VolumeGas.ranked_methods_P
        ):
    if 'EOS' in i:
        i.remove('EOS')

Thanks!!!

yoelcortes commented 2 years ago

Hi Yalin, I believe Sarang also gets this sometimes too. It should be fixed with 5eed839587ed0f5108a808075a9563791cbe7e67.

Thanks for reporting!

yalinli2 commented 2 years ago

Cool (although I'm not sure why remove and append it, but I guess there's a reason)! Thanks!