BioSTEAMDevelopmentGroup / thermosteam

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

Rerunning script raises error #7

Closed yalinli2 closed 4 years ago

yalinli2 commented 4 years ago

Description I have a script that works fine when running for the first time, but will trigger an error about a local variable in thermosteam from the second time on.

To Reproduce Script attached here. chemicals.py.zip

Screenshot

Error

Environment OS: macOS 10.15.3 thermosteam: 0.3.0 python: 3.7.1

Thanks!!!

yoelcortes commented 4 years ago

There is some cache that goes on with creating chemicals. In Spyder settings, make sure Enable UMR is on. This should fix the problem. If not, you could restart the Kernel each time you change the module.

yalinli2 commented 4 years ago

I figured it out - it's not from the UMR (it had been enabled), but it's indeed relatedly to cache.

I used <Chemical>.copy to make a new chemical, but I didn't add certain properties for the reference chemical before making the new chemical. Since there's cache, so the system knows that certain slots of the new chemical should be filled based on the reference chemical, but I haven't added those properties yet... I fixed it now, thanks!!!