Missing use cases for binops on array vs. scalar
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start with the referenced sections of array_api_tests/hypothesis_helpers.py, then inspect test_binary_with_scalars_real in test_operators_and_elementwise_functions.py and test_binary in test_special_cases.py. Compare their generated inputs with the listed integer, special-value, and out-of-range scalar cases; done means the missing cases are covered and the float/complex range behavior is clarified.
Written by the indexing model from the issue text.
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?
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_binaryonly tests arrays containing NaN, not scalar NaN;- none tests
infor arrays containinginf
related:
- Dominant language
- Python
- Stars
- 74
- Forks
- 54
- Avg merge
- 4h 35m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from data-apis/array-api-tests
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
data-apis/array-api-tests#465 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
data-apis/array-api-tests#460 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
data-apis/array-api-tests#455 · 2 comments ·
-
tracking
Difficulty 5/5 Over a week Newbie friendliness 25/100
data-apis/array-api-tests#381 · 9 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
data-apis/array-api-tests#379 · 10 comments ·
All issues in data-apis/array-api-tests
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/skills#1811 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
datalayer/mcp-compose#42 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
UKGovernmentBEIS/inspect_evals#2523 ·