Skip to content

Commit fb0a074

Browse files
committed
Apply @njit to interp and mlinterp
1 parent 3e2f3c1 commit fb0a074

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

interpolation/multilinear/mlinterp.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
# logic of multilinear interpolation
4242

4343

44-
def mlinterp(grid, c, u):
44+
def _mlinterp(grid, c, u):
4545
pass
4646

4747

48-
@overload(mlinterp)
48+
@overload(_mlinterp)
4949
def ol_mlinterp(grid, c, u):
5050
if isinstance(u, UniTuple):
5151

@@ -76,6 +76,11 @@ def mlininterp(grid: Tuple, c: Array, u: Array) -> float:
7676
return mlininterp
7777

7878

79+
@njit
80+
def mlinterp(grid, c, u):
81+
return _mlinterp(grid, c, u)
82+
83+
7984
### The rest of this file constrcts function `interp`
8085

8186
from collections import namedtuple
@@ -217,11 +222,11 @@ def {funname}(*args):
217222
return source
218223

219224

220-
def interp(*args):
225+
def _interp(*args):
221226
pass
222227

223228

224-
@overload(interp)
229+
@overload(_interp)
225230
def ol_interp(*args):
226231
aa = args[0].types
227232

@@ -235,3 +240,8 @@ def ol_interp(*args):
235240
code = compile(tree, "<string>", "exec")
236241
eval(code, globals())
237242
return __mlinterp
243+
244+
245+
@njit
246+
def interp(*args):
247+
return _interp(*args)

0 commit comments

Comments
 (0)