diff --git a/filter_functions/basis.py b/filter_functions/basis.py index bf47b49..97f14ea 100644 --- a/filter_functions/basis.py +++ b/filter_functions/basis.py @@ -281,7 +281,7 @@ def istraceless(self) -> bool: if self._istraceless is None: trace = np.einsum('...jj', self) trace = util.remove_float_errors(trace, self.d**2) - nonzero = trace.nonzero() + nonzero = np.atleast_1d(trace).nonzero() if nonzero[0].size == 0: self._istraceless = True elif nonzero[0].size == 1: diff --git a/tests/test_basis.py b/tests/test_basis.py index 5da71c1..edfacb1 100644 --- a/tests/test_basis.py +++ b/tests/test_basis.py @@ -28,7 +28,6 @@ import numpy as np import pytest from filter_functions import util -from scipy import stats, linalg from sparse import COO from tests import testutil from tests.testutil import rng