Skip to content

Conversation

jvansanten
Copy link
Contributor

@jvansanten jvansanten commented Jul 8, 2025

interp2d is gone in scipy 1.14, and RectBivariateSpline is 5x faster to evaluate

While the numerical results are identical, RectBivariateSpline
returns a 2D array for scalar inputs, whereas interp2d returned a
1D array. Work around this by removing all 1-entry dimensions from
the result. A notable exception is the acceptance in StandardLLH,
which appears to have relied on the result being 1D (i.e. tests
fail if the interpolation returns a scalar).

Fixes #270

@jvansanten jvansanten force-pushed the remove-interp2d branch 3 times, most recently from 2172ffa to 58b7712 Compare July 10, 2025 07:18
interp2d is gone in scipy 1.14, and RecBivariateSpline is 5x faster
to evaluate.

While the numerical results are identical, RectBivariateSpline
returns a 2D array for scalar inputs, whereas interp2d returned a
1D array.  Work around this by removing all 1-entry dimensions from
the result.  A notable exception is the acceptance in StandardLLH,
which appears to have relied on the result being 1D (i.e.  tests
fail if the interpolation returns a scalar).

Fixes icecube#270
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

Successfully merging this pull request may close these issues.

Deprecation of scipy.interpolate.interp2d
1 participant