diff --git a/interpolation/multilinear/mlinterp.py b/interpolation/multilinear/mlinterp.py index c5dae9e..e04265b 100644 --- a/interpolation/multilinear/mlinterp.py +++ b/interpolation/multilinear/mlinterp.py @@ -41,11 +41,11 @@ # logic of multilinear interpolation -def mlinterp(grid, c, u): +def _mlinterp(grid, c, u): pass -@overload(mlinterp) +@overload(_mlinterp) def ol_mlinterp(grid, c, u): if isinstance(u, UniTuple): @@ -76,6 +76,11 @@ def mlininterp(grid: Tuple, c: Array, u: Array) -> float: return mlininterp +@njit +def mlinterp(grid, c, u): + return _mlinterp(grid, c, u) + + ### The rest of this file constrcts function `interp` from collections import namedtuple @@ -217,11 +222,11 @@ def {funname}(*args): return source -def interp(*args): +def _interp(*args): pass -@overload(interp) +@overload(_interp) def ol_interp(*args): aa = args[0].types @@ -235,3 +240,8 @@ def ol_interp(*args): code = compile(tree, "", "exec") eval(code, globals()) return __mlinterp + + +@njit +def interp(*args): + return _interp(*args)