GithubHelp home page GithubHelp logo

Comments (4)

sklam avatar sklam commented on September 2, 2024 2

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.

kp992 avatar kp992 commented on September 2, 2024

@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.

Mv77 avatar Mv77 commented on September 2, 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:

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.

mmcky avatar mmcky commented on September 2, 2024

thanks @sklam for the suggestion here.

from interpolation.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.