Skip to content

Commit

Permalink
Replace removed inner1d
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Sep 16, 2024
1 parent d66e741 commit 59a7ed5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sfs/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import collections
import numpy as np
from numpy.core.umath_tests import inner1d
from scipy.special import spherical_jn, spherical_yn
from . import default

Expand Down Expand Up @@ -576,7 +575,7 @@ def source_selection_point(n0, x0, xs):
x0 = asarray_of_rows(x0)
xs = asarray_1d(xs)
ds = x0 - xs
return inner1d(ds, n0) >= default.selection_tolerance
return _inner1d(ds, n0) >= default.selection_tolerance


def source_selection_line(n0, x0, xs):
Expand All @@ -598,7 +597,7 @@ def source_selection_focused(ns, x0, xs):
xs = asarray_1d(xs)
ns = normalize_vector(ns)
ds = xs - x0
return inner1d(ns, ds) >= default.selection_tolerance
return _inner1d(ns, ds) >= default.selection_tolerance


def source_selection_all(N):
Expand Down Expand Up @@ -646,3 +645,8 @@ def max_order_spherical_harmonics(N):
"""
return int(np.sqrt(N) - 1)


def _inner1d(arr1, arr2):
# https://github.com/numpy/numpy/issues/10815#issuecomment-376847774
return (arr1 * arr2).sum(axis=1)

0 comments on commit 59a7ed5

Please sign in to comment.