Skip to content

Commit 7892670

Browse files
authored
Expand Array API coverage for Numba backend (#691)
* Fix signatures for a few functions. * Fix scalar casting issues. * Add some tests. * Remove spurious function. * Fix `real` and `imag`. * Fix a couple of small issues. * Fix `axis=None` for `concat`. * Fix invalid shapes accepted for `vecdot`. * Attempted fix for docs. * Fix tests for `vecdot`. * Add missing doc pages. * Fix doc pages. * Fix small `vecdot` inconsistencies and separate tests.
1 parent d47b87a commit 7892670

21 files changed

+273
-124
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ jobs:
173173
SPARSE_BACKEND: ${{ matrix.backend }}
174174
run: |
175175
cd ${GITHUB_WORKSPACE}/array-api-tests
176-
pytest array_api_tests -v -c pytest.ini -n 4 --ci --max-examples=2 --derandomize --disable-deadline -o xfail_strict=True --xfails-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}-array-api-xfails.txt --skips-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}-array-api-skips.txt
176+
pytest array_api_tests -v -c pytest.ini -n 4 --max-examples=2 --derandomize --disable-deadline -o xfail_strict=True --xfails-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}-array-api-xfails.txt --skips-file ${GITHUB_WORKSPACE}/ci/${{ matrix.backend }}-array-api-skips.txt
177177
on:
178178
# Trigger the workflow on push or pull request,
179179
# but only for the main branch

ci/Numba-array-api-xfails.txt

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,73 +37,34 @@ array_api_tests/test_has_names.py::test_has_names[creation-linspace]
3737
array_api_tests/test_has_names.py::test_has_names[creation-meshgrid]
3838
array_api_tests/test_has_names.py::test_has_names[sorting-argsort]
3939
array_api_tests/test_has_names.py::test_has_names[data_type-isdtype]
40-
array_api_tests/test_has_names.py::test_has_names[elementwise-conj]
4140
array_api_tests/test_has_names.py::test_has_names[array_method-__dlpack__]
4241
array_api_tests/test_has_names.py::test_has_names[array_method-__dlpack_device__]
4342
array_api_tests/test_has_names.py::test_has_names[array_method-__setitem__]
44-
array_api_tests/test_has_names.py::test_has_names[array_method-to_device]
45-
array_api_tests/test_has_names.py::test_has_names[array_attribute-device]
46-
array_api_tests/test_has_names.py::test_has_names[array_attribute-mT]
4743
array_api_tests/test_indexing_functions.py::test_take
4844
array_api_tests/test_linalg.py::test_vecdot
49-
array_api_tests/test_manipulation_functions.py::test_concat
50-
array_api_tests/test_operators_and_elementwise_functions.py::test_add[__add__(x, s)]
51-
array_api_tests/test_operators_and_elementwise_functions.py::test_add[__iadd__(x, s)]
52-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__lshift__(x, s)]
53-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__ilshift__(x, s)]
54-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__rshift__(x, s)]
55-
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__irshift__(x, s)]
5645
array_api_tests/test_operators_and_elementwise_functions.py::test_ceil
57-
array_api_tests/test_operators_and_elementwise_functions.py::test_conj
58-
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__truediv__(x, s)]
59-
array_api_tests/test_operators_and_elementwise_functions.py::test_imag
60-
array_api_tests/test_operators_and_elementwise_functions.py::test_multiply[__mul__(x, s)]
61-
array_api_tests/test_operators_and_elementwise_functions.py::test_multiply[__imul__(x, s)]
62-
array_api_tests/test_operators_and_elementwise_functions.py::test_pow[__pow__(x, s)]
63-
array_api_tests/test_operators_and_elementwise_functions.py::test_pow[__ipow__(x, s)]
64-
array_api_tests/test_operators_and_elementwise_functions.py::test_real
65-
array_api_tests/test_operators_and_elementwise_functions.py::test_subtract[__sub__(x, s)]
66-
array_api_tests/test_operators_and_elementwise_functions.py::test_subtract[__isub__(x, s)]
6746
array_api_tests/test_operators_and_elementwise_functions.py::test_trunc
6847
array_api_tests/test_searching_functions.py::test_argmax
6948
array_api_tests/test_searching_functions.py::test_argmin
70-
array_api_tests/test_searching_functions.py::test_nonzero_zerodim_error
7149
array_api_tests/test_set_functions.py::test_unique_all
7250
array_api_tests/test_set_functions.py::test_unique_inverse
7351
array_api_tests/test_signatures.py::test_func_signature[unique_all]
7452
array_api_tests/test_signatures.py::test_func_signature[unique_inverse]
7553
array_api_tests/test_signatures.py::test_func_signature[arange]
76-
array_api_tests/test_signatures.py::test_func_signature[empty]
77-
array_api_tests/test_signatures.py::test_func_signature[empty_like]
78-
array_api_tests/test_signatures.py::test_func_signature[eye]
7954
array_api_tests/test_signatures.py::test_func_signature[from_dlpack]
80-
array_api_tests/test_signatures.py::test_func_signature[full]
81-
array_api_tests/test_signatures.py::test_func_signature[full_like]
8255
array_api_tests/test_signatures.py::test_func_signature[linspace]
8356
array_api_tests/test_signatures.py::test_func_signature[meshgrid]
84-
array_api_tests/test_signatures.py::test_func_signature[ones]
85-
array_api_tests/test_signatures.py::test_func_signature[ones_like]
86-
array_api_tests/test_signatures.py::test_func_signature[zeros]
87-
array_api_tests/test_signatures.py::test_func_signature[zeros_like]
88-
array_api_tests/test_signatures.py::test_func_signature[broadcast_to]
89-
array_api_tests/test_signatures.py::test_func_signature[squeeze]
9057
array_api_tests/test_signatures.py::test_func_signature[argsort]
91-
array_api_tests/test_signatures.py::test_func_signature[sort]
9258
array_api_tests/test_signatures.py::test_func_signature[isdtype]
93-
array_api_tests/test_signatures.py::test_func_signature[conj]
9459
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__]
9560
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack_device__]
9661
array_api_tests/test_signatures.py::test_array_method_signature[__setitem__]
97-
array_api_tests/test_signatures.py::test_array_method_signature[to_device]
9862
array_api_tests/test_sorting_functions.py::test_argsort
9963
array_api_tests/test_sorting_functions.py::test_sort
100-
array_api_tests/test_special_cases.py::test_unary[isfinite(x_i is NaN) -> False]
101-
array_api_tests/test_special_cases.py::test_empty_arrays[prod]
10264
array_api_tests/test_special_cases.py::test_nan_propagation[max]
10365
array_api_tests/test_special_cases.py::test_nan_propagation[mean]
10466
array_api_tests/test_special_cases.py::test_nan_propagation[min]
10567
array_api_tests/test_special_cases.py::test_nan_propagation[prod]
10668
array_api_tests/test_special_cases.py::test_nan_propagation[std]
10769
array_api_tests/test_special_cases.py::test_nan_propagation[sum]
10870
array_api_tests/test_special_cases.py::test_nan_propagation[var]
109-
array_api_tests/test_statistical_functions.py::test_mean
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
expand\_dims
2+
============
3+
4+
.. currentmodule:: sparse
5+
6+
.. autofunction:: expand_dims

docs/generated/sparse.flip.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flip
2+
====
3+
4+
.. currentmodule:: sparse
5+
6+
.. autofunction:: flip

docs/generated/sparse.isfinite.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
matrix\_transpose
2+
=================
3+
4+
.. currentmodule:: sparse
5+
6+
.. autofunction:: matrix_transpose

docs/generated/sparse.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ API
8080

8181
full_like
8282

83-
isfinite
84-
8583
isinf
8684

8785
isnan

docs/generated/sparse.sort.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sort
2+
====
3+
4+
.. currentmodule:: sparse
5+
6+
.. autofunction:: sort

docs/generated/sparse.take.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
take
2+
====
3+
4+
.. currentmodule:: sparse
5+
6+
.. autofunction:: take

docs/generated/sparse.var.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var
2+
===
3+
4+
.. currentmodule:: sparse
5+
6+
.. autofunction:: var

0 commit comments

Comments
 (0)