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

SciPy 1.15 renamed interpnd to _interpnd. #306

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion gplately/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,11 @@ def __call__(self, xi, method=None, return_indices=False, return_distances=False
return output_tuple[0]

def _prepare_xi(self, xi):
from scipy.interpolate.interpnd import _ndim_coords_from_arrays
try:
from scipy.interpolate.interpnd import _ndim_coords_from_arrays
except ImportError:
# SciPy 1.15 renamed interpnd to _interpnd (see https://github.com/scipy/scipy/pull/21754).
from scipy.interpolate._interpnd import _ndim_coords_from_arrays

ndim = len(self.grid)
xi = _ndim_coords_from_arrays(xi, ndim=ndim)
Expand Down
6 changes: 5 additions & 1 deletion gplately/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,11 @@ def griddata_sphere(points, values, xi, method="nearest", **kwargs):

assert xi[0].shape == xi[1].shape, "ensure coordinates in xi are the same shape"

from scipy.interpolate.interpnd import _ndim_coords_from_arrays
try:
from scipy.interpolate.interpnd import _ndim_coords_from_arrays
except ImportError:
# SciPy 1.15 renamed interpnd to _interpnd (see https://github.com/scipy/scipy/pull/21754).
from scipy.interpolate._interpnd import _ndim_coords_from_arrays

points = _ndim_coords_from_arrays(points)

Expand Down
Loading