Skip to content

Commit

Permalink
Use functional real()/imag() APIs
Browse files Browse the repository at this point in the history
`real` and `imag` are not properties of API arrays!
  • Loading branch information
honno committed Feb 27, 2024
1 parent a0fde7b commit 0e980e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions array_api_tests/pytest_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def assert_array_elements(
>>> assert xp.all(out == x)
"""
__tracebackhide__ = True
# __tracebackhide__ = True
dh.result_type(out.dtype, expected.dtype) # sanity check
assert_shape(func_name, out_shape=out.shape, expected=expected.shape, kw=kw) # sanity check
f_func = f"[{func_name}({fmt_kw(kw)})]"
Expand All @@ -495,8 +495,8 @@ def assert_array_elements(
if _real_float_strict_equals(out, expected):
return
elif out.dtype in dh.complex_dtypes:
real_match = _real_float_strict_equals(out.real, expected.real)
imag_match = _real_float_strict_equals(out.imag, expected.imag)
real_match = _real_float_strict_equals(xp.real(out), xp.real(expected))
imag_match = _real_float_strict_equals(xp.imag(out), xp.imag(expected))
if real_match and imag_match:
return
else:
Expand Down

0 comments on commit 0e980e6

Please sign in to comment.