Open
Description
After reading hh.scalars
, I understand that array-api-tests
currently never generates the use cases of a binop where one argument is an Array with float or complex dtype and the other argument is
- a pure-python integer;
- a scalar
inf
,-inf
, ornan
; - a scalar outside of the range
[1/64, 64]
Unless I missed something and the tests for these cases are somewhere else?
array-api-tests/array_api_tests/hypothesis_helpers.py
Lines 451 to 481 in c1e5cda
array-api-tests/array_api_tests/hypothesis_helpers.py
Lines 590 to 597 in c1e5cda
Note that the [1/64, 64] range exclusively applies to float/complex. The code could use a clarification there as it is not obvious upon first read that integers ignore it.
e.g. pytest -k minimum
returns this:
array_api_tests/test_has_names.py::test_has_names[elementwise-minimum] PASSED [ 20%]
array_api_tests/test_operators_and_elementwise_functions.py::test_minimum PASSED [ 40%]
array_api_tests/test_operators_and_elementwise_functions.py::test_binary_with_scalars_real[minimum] SKIPPED (requires ARRAY_API_TESTS_VERSION >= 2024.12) [ 60%]
array_api_tests/test_signatures.py::test_func_signature[minimum] PASSED [ 80%]
array_api_tests/test_special_cases.py::test_binary[minimum(x1_i is NaN or x2_i is NaN) -> NaN] PASSED
To my understanding
- in
test_binary_with_scalars_real
, when one arg is Array[float64] or Array[float32], the other arg is always in the[1/64, 64]
range; test_special_cases::test_binary
only tests arrays containing NaN, not scalar NaN;- none tests
inf
or arrays containinginf
related: