Comments (4)
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.
from interpolation.py.
@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]]))
)
from interpolation.py.
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
name: interptest
channels:
- anaconda
- conda-forge
- defaults
dependencies:
- python=3.10
- pip
- packaging
- pip:
- interpolation == 2.2.6
# Name Version Build Channel
bzip2 1.0.8 he774522_0 anaconda
ca-certificates 2023.08.22 haa95532_0 anaconda
interpolation 2.2.6 pypi_0 pypi
libffi 3.4.4 hd77b12b_0 anaconda
llvmlite 0.43.0 pypi_0 pypi
numba 0.60.0 pypi_0 pypi
numpy 2.0.0 pypi_0 pypi
openssl 3.0.12 h2bbff1b_0 anaconda
packaging 23.1 py310haa95532_0 anaconda
pip 23.3 py310haa95532_0 anaconda
python 3.10.13 he1021f5_0 anaconda
scipy 1.13.1 pypi_0 pypi
setuptools 68.0.0 py310haa95532_0 anaconda
sqlite 3.41.2 h2bbff1b_0 anaconda
tk 8.6.12 h2bbff1b_0 anaconda
tzdata 2023c h04d1e81_0 anaconda
vc 14.2 h21ff451_1 anaconda
vs2015_runtime 14.27.29016 h5e58377_2 anaconda
wheel 0.41.2 py310haa95532_0 anaconda
xz 5.4.2 h8cc25b3_0 anaconda
zlib 1.2.13 h8cc25b3_0 anaconda
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.4
with numba==0.58.0
from interpolation.py.
thanks @sklam for the suggestion here.
from interpolation.py.
Related Issues (20)
- After 2.2.0 eval_linear needs C-order and dtype FLOAT64 HOT 3
- guvectorized wrapping of eval_linear() appears broken HOT 2
- DOC: reorganize
- 1D interpolation with eval_linear HOT 5
- Documentation link broken HOT 1
- Import jitclass error HOT 1
- interpolating wind data on the satellilte track (in same lon lat time)
- Documentation for derivatives HOT 9
- Error when running example code in the documentation HOT 3
- `curses` requirement? HOT 6
- Python 3.10 support HOT 2
- Is the dependency on tempita necessary? HOT 7
- `eval_splines` gives error `TypeError: 'module' object is not callable` HOT 2
- "interp" not working with python 3.11 HOT 2
- Errors with multidimensional outputs HOT 4
- eval_spline() doesn't recognize argument `k=` HOT 5
- literal type error when eval_spline() called without some keyword arguments HOT 4
- New version HOT 5
- Numba warnings HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interpolation.py.