Closed siddharthab closed 1 year ago
This seems to be documented in the "Note" section at https://numba.readthedocs.io/en/stable/user/jit.html#cache.
I think it might be good to remove the cache directive everywhere, or do a thorough sweep of all the cached functions to verify that they are self-contained and do not reference other modules or globals.
@siddharthab, thanks for noticing this! No worries, I'm working on updating all places with numba to use objmode to access dynamic values. If you would like to disable numba just in case, you can do so by running these lines at the top of your script (before loading biosteam):
import os
os.environ["NUMBA_DISABLE_JIT"] = "1"
Thanks!
Fixed! Thanks again for posting
Thanks! I did not know about objmode at all.
Describe the bug In some functions like compute_vertical_vessel_purchase_cost, which access biosteam.CE and other settings, the settings constants get inlined into the cached native code. Changing the biosteam.settings value either in the same interpreter session, or in a new session then has no effect. To reset the cached value, one has to delete the
__pycache__
directories in the site-packages biosteam directory.To Reproduce Run the following code in your terminal environment where biosteam is installed.
Expected behavior The second output cost to be double that of the first.
Actual behavior The second output cost was the same as the first.
Version GitHub latest
Additional context
Numba version is 0.57.1 Python version is 3.11.5