EconForge / interpolation.py

BSD 2-Clause "Simplified" License
123 stars 35 forks source link

`eval_splines` gives error `TypeError: 'module' object is not callable` #102

Closed raphaelhuleux closed 1 year ago

raphaelhuleux commented 1 year ago

Hi!

This simple example

from interpolation.splines import prefilter, eval_splines

nZ = 5
nB = 50
nA = 80

a_grid = np.linspace(0,1,nA)
b_grid = np.linspace(0,1,nB)
e_grid = np.linspace(0,1,nZ)

V = np.zeros((nZ,nB,nA))
G = (e_grid, b_grid, a_grid)
C = prefilter(G, V, k=3)
P = (0.0,0.0)

eval_splines(G, C, P, out=None, k=3, diff="None", extrap_mode="linear")

gives an error TypeError: 'module' object is not callable for me. I'm not sure if I'm doing something wrong or if there is an error in the package.

Best,

albop commented 1 year ago

Strange, can you paste the full stacktrace ?

raphaelhuleux commented 1 year ago

Yes!

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Untitled-1 in <module>
     <a href='untitled:Untitled-1?line=10'>11</a> C = prefilter(G, V, k=3)
     <a href='untitled:Untitled-1?line=11'>12</a> P = (0.0,0.0)
---> <a href='untitled:Untitled-1?line=12'>13</a> eval_splines(G, C, P, out=None, k=3, diff="None", extrap_mode="linear")

TypeError: 'module' object is not callable