Skip to content

Commit 21524f7

Browse files
authored
Apply suggestions from code review
1 parent ca4de51 commit 21524f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: array_api_tests/pytest_helpers.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ def assert_fill(
421421
assert xp.all(xp.equal(out, xp.asarray(fill_value, dtype=dtype))), msg
422422

423423

424-
def _has_signbit() -> bool:
424+
def _has_functional_signbit() -> bool:
425+
# signbit can be available but not implemented (e.g., in array-api-strict)
425426
if not hasattr(_xp, "signbit"):
426427
return False
427428
try:
@@ -438,7 +439,7 @@ def _real_float_strict_equals(out: Array, expected: Array) -> bool:
438439

439440
# Test sign of zeroes if xp.signbit() available, otherwise ignore as it's
440441
# not that big of a deal for the perf costs.
441-
if _has_signbit():
442+
if _has_functional_signbit():
442443
out_zero_mask = out == 0
443444
out_sign_mask = _xp.signbit(out)
444445
out_pos_zero_mask = out_zero_mask & out_sign_mask

0 commit comments

Comments
 (0)