Skip to content

Commit 59a7ed5

Browse files
committed
Replace removed inner1d
1 parent d66e741 commit 59a7ed5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sfs/util.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import collections
88
import numpy as np
9-
from numpy.core.umath_tests import inner1d
109
from scipy.special import spherical_jn, spherical_yn
1110
from . import default
1211

@@ -576,7 +575,7 @@ def source_selection_point(n0, x0, xs):
576575
x0 = asarray_of_rows(x0)
577576
xs = asarray_1d(xs)
578577
ds = x0 - xs
579-
return inner1d(ds, n0) >= default.selection_tolerance
578+
return _inner1d(ds, n0) >= default.selection_tolerance
580579

581580

582581
def source_selection_line(n0, x0, xs):
@@ -598,7 +597,7 @@ def source_selection_focused(ns, x0, xs):
598597
xs = asarray_1d(xs)
599598
ns = normalize_vector(ns)
600599
ds = xs - x0
601-
return inner1d(ns, ds) >= default.selection_tolerance
600+
return _inner1d(ns, ds) >= default.selection_tolerance
602601

603602

604603
def source_selection_all(N):
@@ -646,3 +645,8 @@ def max_order_spherical_harmonics(N):
646645
647646
"""
648647
return int(np.sqrt(N) - 1)
648+
649+
650+
def _inner1d(arr1, arr2):
651+
# https://github.com/numpy/numpy/issues/10815#issuecomment-376847774
652+
return (arr1 * arr2).sum(axis=1)

0 commit comments

Comments
 (0)