Does anyone know if there is a way to (in code) disable/enable numba JIT tags for debugging purposes?
Currently, I'm commenting them all out using a select and replace in my IDE however, there must be a way of doing so automatically.
I've already tried using a flag for nopython like:
USE_NOPYTHON = False
@numba.jit(nopython=USE_NOPYTHON)
...
This doesn't disable jit...
Currently doing this manually:
@numba.jit(nopython=True)
def foo():
...
# -->
# @numba.jit(nopython=True)
def foo():
...
However, I would love if something like this was possible (without the ugly IF statements of course):
USE_JIT = False
if USE_JIT:
@numba.jit(nopython=True)
def foo():
...
else:
def foo():
...
Found my answer:
pip install pyyaml
you need to create a file called ".numba_config.yaml" in the directory you typically call your script from.
within the yaml file, put the key "DISABLE_JIT" equal to the value you wish (true/false).
There are many other flags you can use, here is my reference: https://numba.pydata.org/numba-doc/dev/reference/envvars.html#environment-variables
NOTE: when your .yaml file is called ".numba_config.yaml" there is no need to prepend "NUMBA_" to the flag name if you're going off the list found in the reference link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With