Numba - decorators

INTRODUCTION

Numba has several decorators.


@jit
@jit()   # the same as @jit
@jit(nopython=True)
@jit('float64(int64[:,:,:])', nopython=True)   # energy for Ising 3D

@njit   # alias for @jit(nopython=True)
@njit('float64(int64)')   # nopython=True is included

@vectorize   # produces NumPy 'ufunc' (universal functions)
@vectorize([float64(float64, float64)])   # a list of signatures

@guvectorize   # produces NumPy generalized 'ufunc'

The typical example is a running median or a convolution filter.

@stencil   # declare a function as a kernel for a stencil like operation

@jitclass   # for jit aware classes (experimental)

@cfunc   # declare a function for use as a native call back (to be called from C/C++ etc)

@overload   # register your own implementation of a function for use in nopython mode
@overload(scipy.special.j0)