Skip to content

Commit

Permalink
MAINT: revert filter warning.
Browse files Browse the repository at this point in the history
[skip actions] [skip circle]
  • Loading branch information
tupui committed May 21, 2022
1 parent 4d1dace commit f540b1c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scipy/stats/_qmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1786,13 +1786,16 @@ def in_neighborhood(candidate: np.ndarray, n: int = 2) -> bool:

a = [slice(ind_min[i], ind_max[i]) for i in range(self.d)]

if np.any(
np.sum(
np.square(candidate - self.sample_grid[tuple(a)]),
axis=self.d
) < self.radius_squared
):
return True
# guards against: invalid value encountered in less as we are
# comparing with nan and returns False. Which is wanted.
with np.errstate(invalid='ignore'):
if np.any(
np.sum(
np.square(candidate - self.sample_grid[tuple(a)]),
axis=self.d
) < self.squared_radius
):
return True

return False

Expand Down

0 comments on commit f540b1c

Please sign in to comment.