So here's what my code looks like:
@jit(nopython=True)
def sum_fn(arg1, arg2, ...argn):
.....
for i in xrange(len(arg2)): #For each bin
l, p = fn1(arg1, arg2...argn)
res = res + fn2(arg1, arg2, arg3)
return res
@jit(nopython=True)
def fn1(a1, a2,...an):
....
return r1, r2
def fn2(l_lk, l_pk, l_lvals):
f_i = interp1d(l_lk, l_pk,kind='linear') #Scipy.interpolate.interp1d
ftmp = fn3(f_i,l_lk,l_pk)
return 10**ftmp(l_lvals)
It appears that calling fn2 gives an error because it isn't being imported into the numba compilation process, unlike fn1, which is jitted. Unfortunately, I cannot jit fn2 because it uses the scipy.interpolate.interp1d function which isn't recognized by Numba. How can I work around this?