Skip to content

Refactor plan to store output array names #2249

Refactor plan to store output array names

Refactor plan to store output array names #2249

Workflow file for this run

name: Array API Tests
on:
push:
branches:
- "main"
pull_request:
schedule:
# Every weekday at 03:19 UTC, see https://crontab.guru/
- cron: "19 3 * * 1-5"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11"]
zarr: ["<3", ">3"]
steps:
- name: Checkout Cubed
uses: actions/checkout@v3
with:
path: cubed
- name: Checkout Array API tests
uses: actions/checkout@v3
with:
repository: data-apis/array-api-tests
ref: '2025.05.23'
path: array-api-tests
submodules: "true"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install dependencies
run: |
pushd array-api-tests
pip install -e '../cubed[test]'
pip install -r requirements.txt # from Array API tests repo
- name: Install zarr${{ matrix.zarr }}
run: |
pip install -U 'zarr${{ matrix.zarr }}'
- name: Run Array API tests
env:
ARRAY_API_TESTS_MODULE: cubed.array_api
run: |
pushd array-api-tests
# Skip testing functions with known issues
cat << EOF >> skips.txt
# not implemented (elemwise inplace)
array_api_tests/test_operators_and_elementwise_functions.py::test_add[__iadd__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_add[__iadd__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_and[__iand__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_and[__iand__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__ilshift__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[__ilshift__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_or[__ior__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_or[__ior__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__irshift__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[__irshift__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_xor[__ixor__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_xor[__ixor__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__itruediv__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__itruediv__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_multiply[__imul__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_multiply[__imul__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_pow[__ipow__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_pow[__ipow__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_remainder[__imod__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_remainder[__imod__(x, s)]
array_api_tests/test_operators_and_elementwise_functions.py::test_subtract[__isub__(x1, x2)]
array_api_tests/test_operators_and_elementwise_functions.py::test_subtract[__isub__(x, s)]
# special cases not implemented
array_api_tests/test_special_cases.py::test_empty_arrays[std]
array_api_tests/test_special_cases.py::test_empty_arrays[var]
array_api_tests/test_special_cases.py::test_nan_propagation[std]
array_api_tests/test_special_cases.py::test_nan_propagation[var]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
# don't test names yet as some are not implemented
array_api_tests/test_has_names.py
# signatures of items not implemented
array_api_tests/test_signatures.py::test_func_signature[unique_all]
array_api_tests/test_signatures.py::test_func_signature[unique_counts]
array_api_tests/test_signatures.py::test_func_signature[unique_inverse]
array_api_tests/test_signatures.py::test_func_signature[unique_values]
array_api_tests/test_signatures.py::test_func_signature[nonzero]
array_api_tests/test_signatures.py::test_func_signature[from_dlpack]
array_api_tests/test_signatures.py::test_func_signature[argsort]
array_api_tests/test_signatures.py::test_func_signature[sort]
array_api_tests/test_signatures.py::test_func_signature[take_along_axis]
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[__setitem__]
array_api_tests/test_signatures.py::test_array_method_signature[to_device]
# edge case failures (https://github.com/cubed-dev/cubed/issues/420)
array_api_tests/test_linalg.py::test_tensordot
array_api_tests/test_linalg.py::test_vecdot
# (getitem with negative step size is not implemented)
array_api_tests/test_array_object.py::test_getitem
# (indexing with more than one integer index is not implemented)
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_1
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_2
# test_searchsorted depends on sort which is not implemented
array_api_tests/test_searching_functions.py::test_searchsorted
# cumulative_* functions with include_initial=True are not implemented
array_api_tests/test_statistical_functions.py::test_cumulative_prod
array_api_tests/test_statistical_functions.py::test_cumulative_sum
# not implemented
array_api_tests/test_array_object.py::test_setitem
array_api_tests/test_array_object.py::test_setitem_masking
array_api_tests/test_creation_functions.py::test_asarray_arrays
array_api_tests/test_indexing_functions.py::test_take_along_axis
array_api_tests/test_manipulation_functions.py::test_repeat
array_api_tests/test_sorting_functions.py
# finfo return type misalignment (https://github.com/data-apis/array-api/issues/405)
array_api_tests/test_data_type_functions.py::test_finfo[float32]
array_api_tests/test_data_type_functions.py::test_finfo[complex64]
# From https://github.com/data-apis/array-api-tests/blob/master/.github/workflows/numpy.yml
# https://github.com/numpy/numpy/issues/18881
array_api_tests/test_creation_functions.py::test_linspace
# https://github.com/numpy/numpy/issues/20870
#array_api_tests/test_data_type_functions.py::test_can_cast
EOF
pytest -v -rxXfEA --hypothesis-max-examples=2 --disable-data-dependent-shapes --disable-extension linalg --hypothesis-disable-deadline