You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError: 'Integer' object has no attribute 'literal_value' #115
@albop Can you please guide if there are any workarounds? The error is propagated through eval_linear function (Usage: eval_linear(x_grid, V[s], np.array([x[s]])))
Hey @albop, I am running into this same issue with interpolation=2.2.6. The following block from the examples in the docs reproduces the error:
import numpy as np
from interpolation.splines import UCGrid, CGrid, nodes
# we interpolate function
f = lambda x,y: np.sin(np.sqrt(x**2+y**2+0.00001))/np.sqrt(x**2+y**2+0.00001)
# uniform cartesian grid
grid = UCGrid((-1.0, 1.0, 10), (-1.0, 1.0, 10))
# get grid points
gp = nodes(grid) # 100x2 matrix
# compute values on grid points
values = f(gp[:,0], gp[:,1]).reshape((10,10))
from interpolation.splines import eval_linear
# interpolate at one point
point = np.array([0.1,0.45]) # 1d array
val = eval_linear(grid, values, point) # float
# interpolate at many points:
points = np.random.random((10000,2))
eval_linear(grid, values, points) # 10000 vector
The message is
(...)
File "C:\Users\mateo\anaconda3\envs\interptest\lib\site-packages\numba\core\typing\templates.py", line 785, in _build_impl
ovf_result = self._overload_func(*args, **kws)
File "C:\Users\mateo\anaconda3\envs\interptest\lib\site-packages\interpolation\splines\eval_splines.py", line 100, in __eval_spline
kk = (k).literal_value
AttributeError: 'Integer' object has no attribute 'literal_value'
Here is a yml and package list for the env that I am using
Please see numba/numba#9634 (comment) for patch suggestion. The summary is that prefer_literal=True is needed. Problem was hidden in 0.59.1 by the deprecated old-style error.
Activity
kp992 commentedon Jun 24, 2024
@albop Can you please guide if there are any workarounds? The error is propagated through
eval_linearfunction (Usage:eval_linear(x_grid, V[s], np.array([x[s]])))Mv77 commentedon Jun 24, 2024
Hey @albop, I am running into this same issue with
interpolation=2.2.6. The following block from the examples in the docs reproduces the error:The message is
Here is a yml and package list for the env that I am using
It does not work with python 3.11 either.
The latest build I was able to get to work (with a bunch of warnings) was
interpolation==2..2.4withnumba==0.58.0sklam commentedon Jul 3, 2024
Please see numba/numba#9634 (comment) for patch suggestion. The summary is that
prefer_literal=Trueis needed. Problem was hidden in 0.59.1 by the deprecated old-style error.mmcky commentedon Jul 5, 2024
thanks @sklam for the suggestion here.