Skip to content

Commit 81df5f6

Browse files
committed
Fix abs conds not actually absifying
1 parent 22adf72 commit 81df5f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

array_api_tests/test_special_cases.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,11 @@ def cond(i1: float, i2: float) -> bool:
396396
else:
397397
raise ValueParseError(group)
398398

399+
assert not (notify and self.abs_) # sanity check
399400
if notify:
400401
final_cond = lambda i: not _cond(i)
402+
elif self.abs_:
403+
final_cond = lambda i: _cond(abs(i))
401404
else:
402405
final_cond = _cond
403406

0 commit comments

Comments
 (0)