-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Description
What I did
Tried running JIT code in live coding mode. Here's an example from the Numba introduction.
from numba import jit
import numpy as np
x = np.arange(100).reshape(10, 10)
@jit(nopython=True) # Set "nopython" mode for best performance, equivalent to @njit
def go_fast(a): # Function is compiled to machine code when called the first time
trace = 0.0
for i in range(a.shape[0]): # Numba likes loops
trace += np.tanh(a[i, i]) # Numba likes NumPy functions
return a + trace # Numba likes NumPy broadcasting
print(go_fast(x))
What happened
It just displayed an error about being unable to reraise an error.
numba.core.errors.UnsupportedBytecodeError: The re-raising of an exception is not yet supported.. Raised from /home/don/.config/JetBrains/PyCharm2025.2/scratches/scratch.py (11)
Workaround
Just comment out the @jit line, and you can run it in live coding mode.
What could happen
We could monkeypatch the @jit decorator, so it does nothing in live coding mode.
My environment
Describe the versions of everything you were using:
- PyCharm 2025.2.1.1
- Live Coding plugin 4.12.0
- Ubuntu 22.04.5 LTS; glibc: 2.35
- Python 3.10.12
Reactions are currently unavailable