@@ -112,7 +112,7 @@ def test_unique_all(x):
112
112
113
113
if dh .is_float_dtype (out .values .dtype ):
114
114
assume (math .prod (x .shape ) <= 128 ) # may not be representable
115
- expected = sum (v for k , v in counts .items () if math .isnan (k ))
115
+ expected = sum (v for k , v in counts .items () if cmath .isnan (k ))
116
116
assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
117
117
118
118
@@ -137,7 +137,7 @@ def test_unique_counts(x):
137
137
for idx in sh .ndindex (out .values .shape ):
138
138
val = scalar_type (out .values [idx ])
139
139
count = int (out .counts [idx ])
140
- if math .isnan (val ):
140
+ if cmath .isnan (val ):
141
141
nans += 1
142
142
assert count == 1 , (
143
143
f"out.counts[{ idx } ]={ count } for out.values[{ idx } ]={ val } , "
@@ -159,7 +159,7 @@ def test_unique_counts(x):
159
159
vals_idx [val ] = idx
160
160
if dh .is_float_dtype (out .values .dtype ):
161
161
assume (math .prod (x .shape ) <= 128 ) # may not be representable
162
- expected = sum (v for k , v in counts .items () if math .isnan (k ))
162
+ expected = sum (v for k , v in counts .items () if cmath .isnan (k ))
163
163
assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
164
164
165
165
@@ -188,7 +188,7 @@ def test_unique_inverse(x):
188
188
nans = 0
189
189
for idx in sh .ndindex (out .values .shape ):
190
190
val = scalar_type (out .values [idx ])
191
- if math .isnan (val ):
191
+ if cmath .isnan (val ):
192
192
nans += 1
193
193
else :
194
194
assert (
0 commit comments