Skip to content

Commit f9f0adf

Browse files
committed
Adapt to nonzero 0d deprecation
1 parent c87a7b6 commit f9f0adf

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

filter_functions/basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def istraceless(self) -> bool:
281281
if self._istraceless is None:
282282
trace = np.einsum('...jj', self)
283283
trace = util.remove_float_errors(trace, self.d**2)
284-
nonzero = trace.nonzero()
284+
nonzero = np.atleast_1d(trace).nonzero()
285285
if nonzero[0].size == 0:
286286
self._istraceless = True
287287
elif nonzero[0].size == 1:

tests/test_basis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import numpy as np
2929
import pytest
3030
from filter_functions import util
31-
from scipy import stats, linalg
3231
from sparse import COO
3332
from tests import testutil
3433
from tests.testutil import rng

0 commit comments

Comments
 (0)