Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster - depends #1

Open
prisae opened this issue May 23, 2019 · 1 comment
Open

Faster - depends #1

prisae opened this issue May 23, 2019 · 1 comment

Comments

@prisae
Copy link

prisae commented May 23, 2019

Hi @jglaser!

Thanks so much for sharing this, awesome! I am looking for faster solutions myself. I tried with numba, and failed, and I tried your approach, and it is not faster either.

I think you have to be careful when stating

A faster 3D interpolation to replace scipy.interpolate.RegularGridInterpolator()

In your example you have a massive grid, and in this you interpolate one point. In this case it is indeed possible to achieve faster versions than the SciPy version, as SciPy has some overhead to set it up.

However, instead of your example:

x0, y0, z0 = (1.1,0.25, 7.5)

how about if I want to interpolate not one point, but for an even denser grid, hence

x0 = np.linspace(0,2.5,200)
y0 = np.linspace(-1,.5,100)
z0 = np.linspace(5,25,250)
X0, Y0, Z0 = np.meshgrid(x0, y0, z0, indexing='ij')

In SciPy I can do

interp_si((X0, Y0, Z0))

But your function only accepts size-1 arrays, so I have to loop over it which will be much slower for five million points.

It is not really an issue, I was just interested in your opinion as you worked on improving/speeding-up RegularGridInterpolator.

@cutright
Copy link

I'd also be interested in implementing this code, but I've found RegularGridInterpolator to actually be 5% faster when working with a 162x162x101 grid and ~2.6 million point calculations. I'm on SciPy 1.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants