Is there a reason for structured array type having to be defined outside Numba function? This snippet:
import numpy as np, numba as nb
Point = np.dtype([('x', 'f4'), ('y', 'f4')])
@nb.njit
def f():
a = np.zeros((2,), dtype=Point)
# a = np.zeros((2,), dtype=np.dtype([('x', 'f4'), ('y', 'f4')]))
a['x'][0] = 42
return a
compiles, but the commented line doesn’t.