Skip to content

Commit 74a73a9

Browse files
committed
Update NumPy workflow for new special cases
1 parent e4b6fa8 commit 74a73a9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/numpy.yml

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ jobs:
4343
# waiting on NumPy to allow/revert distinct NaNs for np.unique
4444
# https://github.com/numpy/numpy/issues/20326#issuecomment-1012380448
4545
array_api_tests/test_set_functions.py
46+
# noted diversions from spec
47+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i == +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
48+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i == +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
49+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i == -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
50+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i == -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
51+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i == -infinity) -> -0]
52+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i == +infinity) -> -0]
4653
4754
EOF
4855

array_api_tests/test_special_cases.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,9 @@ def partial_cond(i1: float, i2: float) -> bool:
705705
elif r_or_input.match(input_str):
706706
left_expr = expr_template.replace("{}", "x1_i")
707707
right_expr = expr_template.replace("{}", "x2_i")
708-
partial_expr = f"({left_expr}) or ({right_expr})"
708+
partial_expr = f"{left_expr} or {right_expr}"
709+
if len(cond_strs) != 1:
710+
partial_expr = f"({partial_expr})"
709711
cond_arg = BinaryCondArg.EITHER
710712
else:
711713
raise ValueParseError(input_str)

0 commit comments

Comments
 (0)