Skip to content

Commit

Permalink
Use better keyword argument name
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Jun 16, 2023
1 parent 00c56c9 commit 9064d5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions array_api_tests/dtype_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ def is_int_dtype(dtype):
return dtype in all_int_dtypes


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

Expand Down
4 changes: 2 additions & 2 deletions array_api_tests/test_statistical_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_prod(x, data):
_dtype = x.dtype
else:
_dtype = default_dtype
elif dh.is_float_dtype(x.dtype, real=True):
elif dh.is_float_dtype(x.dtype, include_complex=False):
if dh.dtype_nbits[x.dtype] > dh.dtype_nbits[dh.default_float]:
_dtype = x.dtype
else:
Expand Down Expand Up @@ -261,7 +261,7 @@ def test_sum(x, data):
_dtype = x.dtype
else:
_dtype = default_dtype
elif dh.is_float_dtype(x.dtype, real=True):
elif dh.is_float_dtype(x.dtype, include_complex=False):
if dh.dtype_nbits[x.dtype] > dh.dtype_nbits[dh.default_float]:
_dtype = x.dtype
else:
Expand Down

0 comments on commit 9064d5d

Please sign in to comment.