File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,15 @@ def is_int_dtype(dtype):
157
157
return dtype in all_int_dtypes
158
158
159
159
160
- def is_float_dtype (dtype , real = False ):
160
+ def is_float_dtype (dtype , * , include_complex = True ):
161
161
# None equals NumPy's xp.float64 object, so we specifically check it here.
162
162
# xp.float64 is in fact an alias of np.dtype('float64'), and its equality
163
163
# with None is meant to be deprecated at some point.
164
164
# See https://github.com/numpy/numpy/issues/18434
165
165
if dtype is None :
166
166
return False
167
167
valid_dtypes = real_float_dtypes
168
- if api_version > "2021.12" and not real :
168
+ if api_version > "2021.12" and include_complex :
169
169
valid_dtypes += complex_dtypes
170
170
return dtype in valid_dtypes
171
171
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def test_prod(x, data):
145
145
_dtype = x .dtype
146
146
else :
147
147
_dtype = default_dtype
148
- elif dh .is_float_dtype (x .dtype , real = True ):
148
+ elif dh .is_float_dtype (x .dtype , include_complex = False ):
149
149
if dh .dtype_nbits [x .dtype ] > dh .dtype_nbits [dh .default_float ]:
150
150
_dtype = x .dtype
151
151
else :
@@ -261,7 +261,7 @@ def test_sum(x, data):
261
261
_dtype = x .dtype
262
262
else :
263
263
_dtype = default_dtype
264
- elif dh .is_float_dtype (x .dtype , real = True ):
264
+ elif dh .is_float_dtype (x .dtype , include_complex = False ):
265
265
if dh .dtype_nbits [x .dtype ] > dh .dtype_nbits [dh .default_float ]:
266
266
_dtype = x .dtype
267
267
else :
You can’t perform that action at this time.
0 commit comments