Skip to content

Commit

Permalink
Update array API tests without adding complex number support (#37)
Browse files Browse the repository at this point in the history
Co-authored-by: Aditya Goel <48102515+adityagoel4512@users.noreply.github.com>
Co-authored-by: Aditya Goel <agoel4512@gmail.com>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 28f5773 commit 75de95e
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 113 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/array-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ jobs:
- name: Install repository
run: pixi run postinstall
- name: Run Array API tests
env:
ARRAY_API_TESTS_MODULE: ndonnx
run: |
pushd api-coverage-tests
pixi run pytest --ci --max-examples 2 array_api_tests/ --json-report --json-report-file=api-coverage-tests.json -n auto -vv --skips-file=../skips.txt
popd
run: pixi run arrayapitests
- name: Upload Array API tests report
uses: actions/upload-artifact@v4
with:
name: api-coverage-tests
path: api-coverage-tests/api-coverage-tests.json
path: api-coverage-tests.json
2 changes: 1 addition & 1 deletion api-coverage-tests
Submodule api-coverage-tests updated 52 files
+2 −0 .flake8
+8 −5 .github/workflows/test.yml
+4 −0 .gitignore
+32 −46 README.md
+1 −1 array-api
+8 −0 array-api-strict-skips.txt
+40 −6 array_api_tests/__init__.py
+4 −34 array_api_tests/_array_module.py
+28 −6 array_api_tests/array_helpers.py
+94 −23 array_api_tests/dtype_helpers.py
+130 −68 array_api_tests/hypothesis_helpers.py
+0 −19 array_api_tests/meta/test_array_helpers.py
+108 −13 array_api_tests/pytest_helpers.py
+6 −4 array_api_tests/shape_helpers.py
+33 −7 array_api_tests/stubs.py
+29 −31 array_api_tests/test_array_object.py
+6 −3 array_api_tests/test_constants.py
+44 −57 array_api_tests/test_creation_functions.py
+15 −24 array_api_tests/test_data_type_functions.py
+306 −0 array_api_tests/test_fft.py
+5 −7 array_api_tests/test_has_names.py
+3 −5 array_api_tests/test_indexing_functions.py
+43 −0 array_api_tests/test_inspection_functions.py
+489 −150 array_api_tests/test_linalg.py
+115 −16 array_api_tests/test_manipulation_functions.py
+256 −76 array_api_tests/test_operators_and_elementwise_functions.py
+54 −16 array_api_tests/test_searching_functions.py
+9 −10 array_api_tests/test_set_functions.py
+16 −4 array_api_tests/test_signatures.py
+8 −9 array_api_tests/test_sorting_functions.py
+134 −158 array_api_tests/test_special_cases.py
+105 −73 array_api_tests/test_statistical_functions.py
+6 −7 array_api_tests/test_utility_functions.py
+91 −30 conftest.py
+0 −26 environment.yml
+1 −0 meta_tests/README.md
+0 −0 meta_tests/__init__.py
+35 −0 meta_tests/test_array_helpers.py
+1 −1 meta_tests/test_broadcasting.py
+1 −1 meta_tests/test_equality_mapping.py
+14 −16 meta_tests/test_hypothesis_helpers.py
+16 −0 meta_tests/test_linalg.py
+4 −4 meta_tests/test_partial_adopters.py
+12 −5 meta_tests/test_pytest_helpers.py
+1 −1 meta_tests/test_signatures.py
+1 −1 meta_tests/test_special_cases.py
+8 −8 meta_tests/test_utils.py
+0 −41 numpy-skips.txt
+0 −5 pyproject.toml
+0 −0 pytest.ini
+5 −5 reporting.py
+1 −1 requirements.txt
10 changes: 9 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ hypothesis = "*"
onnxruntime = "*"
mypy = ">=1.10.0,<1.11"
ndindex = "*"

[feature.test.tasks]
test = "pytest"
test-coverage = "pytest --cov=ndonnx --cov-report=xml --cov-report=term-missing"
arrayapitests = "ARRAY_API_TESTS_MODULE=ndonnx pytest --max-examples 2 api-coverage-tests/array_api_tests/ --json-report --json-report-file=api-coverage-tests.json -n auto -vv --skips-file=skips.txt"

[feature.test.tasks.arrayapitests]
cmd = "pytest --max-examples 16 api-coverage-tests/array_api_tests/ -v -rfX --json-report --json-report-file=api-coverage-tests.json -n auto --disable-deadline --disable-extension linalg --skips-file=skips.txt --xfails-file=xfails.txt --hypothesis-seed=0"
[feature.test.tasks.arrayapitests.env]
ARRAY_API_TESTS_MODULE="ndonnx"
ARRAY_API_TESTS_VERSION="2023.12"
ARRAY_API_TESTS_SKIP_DTYPES="complex64,complex128"


[feature.lint.dependencies]
pre-commit = "*"
Expand Down
108 changes: 4 additions & 104 deletions skips.txt
Original file line number Diff line number Diff line change
@@ -1,104 +1,4 @@
array_api_tests/test_creation_functions.py::test_meshgrid
array_api_tests/test_has_names.py::test_has_names[array_attribute-device]
array_api_tests/test_has_names.py::test_has_names[array_method-__dlpack__]
array_api_tests/test_has_names.py::test_has_names[array_method-__dlpack_device__]
array_api_tests/test_has_names.py::test_has_names[array_method-to_device]
array_api_tests/test_has_names.py::test_has_names[linalg-det]
array_api_tests/test_has_names.py::test_has_names[linalg-diagonal]
array_api_tests/test_has_names.py::test_has_names[linalg-eigh]
array_api_tests/test_has_names.py::test_has_names[linalg-eigvalsh]
array_api_tests/test_has_names.py::test_has_names[linalg-inv]
array_api_tests/test_has_names.py::test_has_names[linalg-matmul]
array_api_tests/test_has_names.py::test_has_names[linalg-matrix_norm]
array_api_tests/test_has_names.py::test_has_names[linalg-matrix_power]
array_api_tests/test_has_names.py::test_has_names[linalg-matrix_rank]
array_api_tests/test_has_names.py::test_has_names[linalg-matrix_transpose]
array_api_tests/test_has_names.py::test_has_names[linalg-outer]
array_api_tests/test_has_names.py::test_has_names[linalg-pinv]
array_api_tests/test_has_names.py::test_has_names[linalg-qr]
array_api_tests/test_has_names.py::test_has_names[linalg-slogdet]
array_api_tests/test_has_names.py::test_has_names[linalg-solve]
array_api_tests/test_has_names.py::test_has_names[linalg-svd]
array_api_tests/test_has_names.py::test_has_names[linalg-svdvals]
array_api_tests/test_has_names.py::test_has_names[linalg-tensordot]
array_api_tests/test_has_names.py::test_has_names[linalg-trace]
array_api_tests/test_has_names.py::test_has_names[linalg-vecdot]
array_api_tests/test_has_names.py::test_has_names[linalg-vector_norm]
array_api_tests/test_has_names.py::test_has_names[linear_algebra-tensordot]
array_api_tests/test_has_names.py::test_has_names[linear_algebra-vecdot]
array_api_tests/test_has_names.py::test_has_names[linalg-cross]
array_api_tests/test_has_names.py::test_has_names[linalg-cholesky]
array_api_tests/test_linalg.py
array_api_tests/test_set_functions.py::test_unique_all
array_api_tests/test_set_functions.py::test_unique_counts
array_api_tests/test_set_functions.py::test_unique_inverse
array_api_tests/test_set_functions.py::test_unique_values
array_api_tests/test_signatures.py::test_array_method_signature[__array_namespace__]
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__]
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack_device__]
array_api_tests/test_signatures.py::test_array_method_signature[to_device]
array_api_tests/test_signatures.py::test_func_signature[from_dlpack]
array_api_tests/test_signatures.py::test_func_signature[tensordot]
array_api_tests/test_signatures.py::test_func_signature[vecdot]
array_api_tests/test_signatures.py::test_func_signature[meshgrid]
array_api_tests/test_sorting_functions.py::test_argsort
array_api_tests/test_special_cases.py::test_binary[__mod__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> x2_i]
array_api_tests/test_special_cases.py::test_binary[__mod__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> x2_i]
array_api_tests/test_special_cases.py::test_binary[__mod__(x1_i is +0 and x2_i < 0) -> -0]
array_api_tests/test_special_cases.py::test_binary[__mod__(x1_i is -0 and x2_i > 0) -> +0]
array_api_tests/test_special_cases.py::test_binary[add(x1_i is -infinity and x2_i is -infinity) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is +infinity and x2_i is -infinity) -> roughly +3pi/4]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i < 0 and x2_i is -0) -> roughly -pi/2]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i > 0 and isfinite(x1_i) and x2_i is -infinity) -> roughly +pi]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i > 0 and x2_i is -0) -> roughly +pi/2]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is +0 and x2_i < 0) -> roughly +pi]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is +0 and x2_i is +0) -> +0]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is +0 and x2_i is -0) -> roughly +pi]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is -0 and x2_i < 0) -> roughly -pi]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is -0 and x2_i is +0) -> -0]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is -0 and x2_i is -0) -> roughly -pi]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is -infinity and x2_i is +infinity) -> roughly -pi/4]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is -infinity and x2_i is -infinity) -> roughly -3pi/4]
array_api_tests/test_special_cases.py::test_binary[floor_divide(copysign(1, x1_i) != copysign(1, x2_i) and isfinite(x1_i) and x1_i != 0 and isfinite(x2_i) and x2_i != 0) -> negative sign]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(copysign(1, x1_i) != copysign(1, x2_i) and isfinite(x1_i) and x1_i != 0 and isfinite(x2_i) and x2_i != 0) -> negative sign]
array_api_tests/test_special_cases.py::test_binary[__floordiv__((x1_i is +infinity or x1_i == -infinity) and (x2_i is +infinity or x2_i == -infinity)) -> NaN]
array_api_tests/test_special_cases.py::test_binary[remainder(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> x2_i]
array_api_tests/test_special_cases.py::test_binary[remainder(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> x2_i]
array_api_tests/test_special_cases.py::test_binary[remainder(x1_i is +0 and x2_i < 0) -> -0]
array_api_tests/test_special_cases.py::test_binary[remainder(x1_i is -0 and x2_i > 0) -> +0]
array_api_tests/test_special_cases.py::test_empty_arrays[prod]
array_api_tests/test_special_cases.py::test_iop[__imod__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> x2_i]
array_api_tests/test_special_cases.py::test_iop[__imod__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> x2_i]
array_api_tests/test_special_cases.py::test_iop[__imod__(x1_i is +0 and x2_i < 0) -> -0]
array_api_tests/test_special_cases.py::test_iop[__imod__(x1_i is -0 and x2_i > 0) -> +0]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(copysign(1, x1_i) != copysign(1, x2_i) and isfinite(x1_i) and x1_i != 0 and isfinite(x2_i) and x2_i != 0) -> negative sign]
array_api_tests/test_special_cases.py::test_nan_propagation[prod]
array_api_tests/test_special_cases.py::test_unary[acos(x_i < -1) -> NaN]
array_api_tests/test_special_cases.py::test_unary[acos(x_i > 1) -> NaN]
array_api_tests/test_special_cases.py::test_unary[asin(x_i < -1) -> NaN]
array_api_tests/test_special_cases.py::test_unary[asin(x_i > 1) -> NaN]
array_api_tests/test_special_cases.py::test_unary[atanh(x_i < -1) -> NaN]
array_api_tests/test_special_cases.py::test_unary[atanh(x_i > 1) -> NaN]
array_api_tests/test_special_cases.py::test_unary[expm1(x_i is -0) -> -0]
array_api_tests/test_special_cases.py::test_unary[log1p(x_i is +0) -> +0]
array_api_tests/test_special_cases.py::test_unary[log1p(x_i is -0) -> -0]
array_api_tests/test_special_cases.py::test_unary[log1p(x_i is -1) -> -infinity]
array_api_tests/test_special_cases.py::test_unary[sinh(x_i is +0) -> +0]
array_api_tests/test_special_cases.py::test_unary[sinh(x_i is +infinity) -> +infinity]
array_api_tests/test_special_cases.py::test_unary[sinh(x_i is -0) -> -0]
array_api_tests/test_special_cases.py::test_unary[sinh(x_i is -infinity) -> -infinity]
array_api_tests/test_special_cases.py::test_unary[sinh(x_i is NaN) -> NaN]
array_api_tests/test_special_cases.py::test_unary[sqrt(x_i < 0) -> NaN]
array_api_tests/test_statistical_functions.py::test_prod
array_api_tests/test_statistical_functions.py::test_std
array_api_tests/test_statistical_functions.py::test_var
array_api_tests/test_statistical_functions.py::test_sum
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i < 0 and isfinite(x1_i) and x2_i is -infinity) -> roughly -pi]
array_api_tests/test_special_cases.py::test_binary[atan2(x1_i is +infinity and x2_i is +infinity) -> roughly +pi/4]
array_api_tests/test_has_names.py::test_has_names[array_attribute-size]
array_api_tests/test_has_names.py::test_has_names[creation-from_dlpack]
array_api_tests/test_has_names.py::test_has_names[creation-meshgrid]
array_api_tests/test_operators_and_elementwise_functions.py::test_pow
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide
array_api_tests/test_operators_and_elementwise_functions.py::test_atan2
array_api_tests/test_operators_and_elementwise_functions.py::test_sinh
# The following tests cause segfaults

array_api_tests/test_manipulation_functions.py::test_roll
array_api_tests/test_data_type_functions.py::test_broadcast_arrays
Loading

0 comments on commit 75de95e

Please sign in to comment.