Skip to content

Commit 9064d5d

Browse files
committed
Use better keyword argument name
1 parent 00c56c9 commit 9064d5d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

array_api_tests/dtype_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ def is_int_dtype(dtype):
157157
return dtype in all_int_dtypes
158158

159159

160-
def is_float_dtype(dtype, real=False):
160+
def is_float_dtype(dtype, *, include_complex=True):
161161
# None equals NumPy's xp.float64 object, so we specifically check it here.
162162
# xp.float64 is in fact an alias of np.dtype('float64'), and its equality
163163
# with None is meant to be deprecated at some point.
164164
# See https://github.com/numpy/numpy/issues/18434
165165
if dtype is None:
166166
return False
167167
valid_dtypes = real_float_dtypes
168-
if api_version > "2021.12" and not real:
168+
if api_version > "2021.12" and include_complex:
169169
valid_dtypes += complex_dtypes
170170
return dtype in valid_dtypes
171171

array_api_tests/test_statistical_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_prod(x, data):
145145
_dtype = x.dtype
146146
else:
147147
_dtype = default_dtype
148-
elif dh.is_float_dtype(x.dtype, real=True):
148+
elif dh.is_float_dtype(x.dtype, include_complex=False):
149149
if dh.dtype_nbits[x.dtype] > dh.dtype_nbits[dh.default_float]:
150150
_dtype = x.dtype
151151
else:
@@ -261,7 +261,7 @@ def test_sum(x, data):
261261
_dtype = x.dtype
262262
else:
263263
_dtype = default_dtype
264-
elif dh.is_float_dtype(x.dtype, real=True):
264+
elif dh.is_float_dtype(x.dtype, include_complex=False):
265265
if dh.dtype_nbits[x.dtype] > dh.dtype_nbits[dh.default_float]:
266266
_dtype = x.dtype
267267
else:

0 commit comments

Comments
 (0)