diff --git a/.github/workflows/array-api-tests.yml b/.github/workflows/array-api-tests.yml index 5c8f9f4b..d60176ce 100644 --- a/.github/workflows/array-api-tests.yml +++ b/.github/workflows/array-api-tests.yml @@ -76,7 +76,7 @@ jobs: if: "! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))" env: ARRAY_API_TESTS_MODULE: array_api_compat.${{ inputs.module-name || inputs.package-name }} - ARRAY_API_TESTS_VERSION: 2023.12 + ARRAY_API_TESTS_VERSION: 2024.12 # This enables the NEP 50 type promotion behavior (without it a lot of # tests fail on bad scalar type promotion behavior) NPY_PROMOTION_STATE: weak diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 7b975aa5..7733059d 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -88,15 +88,21 @@ jobs: - name: List all files run: ls -lh dist - - name: Publish distribution 📦 to Test PyPI - # Publish to TestPyPI on tag events of if manually triggered - # Compare to 'true' string as booleans get turned into strings in the console - if: >- - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) - || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') + # - name: Publish distribution 📦 to Test PyPI + # # Publish to TestPyPI on tag events of if manually triggered + # # Compare to 'true' string as booleans get turned into strings in the console + # if: >- + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) + # || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') + # uses: pypa/gh-action-pypi-publish@v1.12.4 + # with: + # repository-url: https://test.pypi.org/legacy/ + # print-hash: true + + - name: Publish distribution 📦 to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@v1.12.4 with: - repository-url: https://test.pypi.org/legacy/ print-hash: true - name: Create GitHub Release from a Tag @@ -104,9 +110,3 @@ jobs: if: startsWith(github.ref, 'refs/tags/') with: files: dist/* - - - name: Publish distribution 📦 to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.12.4 - with: - print-hash: true diff --git a/array_api_compat/__init__.py b/array_api_compat/__init__.py index a333b8f3..cbc6e944 100644 --- a/array_api_compat/__init__.py +++ b/array_api_compat/__init__.py @@ -17,6 +17,6 @@ this implementation for the default when working with NumPy arrays. """ -__version__ = '1.10.1.dev0' +__version__ = '1.11' from .common import * # noqa: F401, F403 diff --git a/array_api_compat/common/_helpers.py b/array_api_compat/common/_helpers.py index 80239c06..791edb81 100644 --- a/array_api_compat/common/_helpers.py +++ b/array_api_compat/common/_helpers.py @@ -432,11 +432,11 @@ def is_array_api_strict_namespace(xp) -> bool: def _check_api_version(api_version: str) -> None: - if api_version in ['2021.12', '2022.12']: - warnings.warn(f"The {api_version} version of the array API specification was requested but the returned namespace is actually version 2023.12") + if api_version in ['2021.12', '2022.12', '2023.12']: + warnings.warn(f"The {api_version} version of the array API specification was requested but the returned namespace is actually version 2024.12") elif api_version is not None and api_version not in ['2021.12', '2022.12', - '2023.12']: - raise ValueError("Only the 2023.12 version of the array API specification is currently supported") + '2023.12', '2024.12']: + raise ValueError("Only the 2024.12 version of the array API specification is currently supported") def array_namespace(*xs, api_version=None, use_compat=None) -> Namespace: @@ -451,7 +451,7 @@ def array_namespace(*xs, api_version=None, use_compat=None) -> Namespace: api_version: str The newest version of the spec that you need support for (currently - the compat library wrapped APIs support v2023.12). + the compat library wrapped APIs support v2024.12). use_compat: bool or None If None (the default), the native namespace will be returned if it is diff --git a/array_api_compat/cupy/__init__.py b/array_api_compat/cupy/__init__.py index d8685761..59e01058 100644 --- a/array_api_compat/cupy/__init__.py +++ b/array_api_compat/cupy/__init__.py @@ -13,4 +13,4 @@ from ..common._helpers import * # noqa: F401,F403 -__array_api_version__ = '2023.12' +__array_api_version__ = '2024.12' diff --git a/array_api_compat/dask/array/__init__.py b/array_api_compat/dask/array/__init__.py index b49be6cf..a6e69ad3 100644 --- a/array_api_compat/dask/array/__init__.py +++ b/array_api_compat/dask/array/__init__.py @@ -3,7 +3,7 @@ # These imports may overwrite names from the import * above. from ._aliases import * # noqa: F403 -__array_api_version__ = '2023.12' +__array_api_version__ = '2024.12' __import__(__package__ + '.linalg') __import__(__package__ + '.fft') diff --git a/array_api_compat/numpy/__init__.py b/array_api_compat/numpy/__init__.py index 9bdbf312..02c55d28 100644 --- a/array_api_compat/numpy/__init__.py +++ b/array_api_compat/numpy/__init__.py @@ -27,4 +27,4 @@ except ImportError: pass -__array_api_version__ = '2023.12' +__array_api_version__ = '2024.12' diff --git a/array_api_compat/py.typed b/array_api_compat/py.typed deleted file mode 100644 index e69de29b..00000000 diff --git a/array_api_compat/torch/__init__.py b/array_api_compat/torch/__init__.py index cfa3acf8..a985986e 100644 --- a/array_api_compat/torch/__init__.py +++ b/array_api_compat/torch/__init__.py @@ -21,4 +21,4 @@ from ..common._helpers import * # noqa: F403 -__array_api_version__ = '2023.12' +__array_api_version__ = '2024.12' diff --git a/cupy-xfails.txt b/cupy-xfails.txt index f30004c1..097a96fa 100644 --- a/cupy-xfails.txt +++ b/cupy-xfails.txt @@ -182,3 +182,14 @@ array_api_tests/test_fft.py::test_irfftn array_api_tests/test_manipulation_functions.py::test_repeat array_api_tests/test_signatures.py::test_func_signature[from_dlpack] array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__] + ++# 2024.12 support +array_api_tests/test_signatures.py::test_func_signature[count_nonzero] +array_api_tests/test_signatures.py::test_func_signature[bitwise_and] +array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_or] +array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_xor] +array_api_tests/test_special_cases.py::test_binary[nextafter(x1_i is +0 and x2_i is -0) -> -0] +array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod] + diff --git a/dask-xfails.txt b/dask-xfails.txt index 9b6406d0..4d0e2ee8 100644 --- a/dask-xfails.txt +++ b/dask-xfails.txt @@ -91,3 +91,45 @@ array_api_tests/test_creation_functions.py::test_arange # 2023.12 support array_api_tests/test_manipulation_functions.py::test_repeat + +# 2024.12 support +array_api_tests/test_array_object.py::test_setitem +array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_1[1] +array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_1[None] +array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_2[1] +array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_2[None] +array_api_tests/test_has_names.py::test_has_names[indexing-take_along_axis] +array_api_tests/test_signatures.py::test_func_signature[take_along_axis] + +array_api_tests/test_linalg.py::test_cholesky +array_api_tests/test_linalg.py::test_linalg_matmul +array_api_tests/test_linalg.py::test_matrix_norm +array_api_tests/test_linalg.py::test_qr +array_api_tests/test_manipulation_functions.py::test_concat +array_api_tests/test_manipulation_functions.py::test_roll +array_api_tests/test_operators_and_elementwise_functions.py::test_add[add(x1, x2)] +array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[bitwise_left_shift(x1, x2)] +array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[bitwise_right_shift(x1, x2)] +array_api_tests/test_operators_and_elementwise_functions.py::test_greater[__gt__(x1, x2)] +array_api_tests/test_signatures.py::test_func_signature[count_nonzero] +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] +array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod] + + diff --git a/docs/changelog.md b/docs/changelog.md index 4b59edca..1de11606 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,60 @@ # Changelog +## 1.11.0 (2025-XX-XX) + +### Major Changes + +This release targets the 2024.12 Array API revision. This includes + + - `__array_api_version__` for the wrapped APIs is now set to `2024.12`; + - Wrappers for `count_nonzero`; + - Wrappers for `cumulative_prod`; + - Wrappers for `take_along_axis` (with the exception of Dask); + - Wrappers for `diff`; + - `__capabilities__` dict contains a `max_dimensions` key; + - Python scalars are accepted as arguments to `result_type`; + - `fft.fftfreq` and `fft.rfftfreq` functions now accept an optional `dtype` + argument to control the output data type. + +Note that these wrappers, as well as other 2024.12 features, are relatively undertested +in this release, and may have rough edges. Please report any issues you encounter +in [the issue tracker](https://github.com/data-apis/array-api-compat/issues). + +New functions to test properties of arrays: + - `is_writeable_array` (benefits NumPy, JAX, Sparse) + - `is_lazy_array` (benefits JAX, Dask, ndonnx) + +Improved support for JAX: + - Work arounds for `.device` attribute and `to_device` function + not working correctly within `jax.jit` + +### Minor Changes + +- Several improvements to `dask.array` wrappers: + + - `size` returns None for arrays of unknown shapes. + - `astype(..., copy=True)` always copies, independently of the Dask version. + - implementations of `sort` and `argsort` are now available. Note that these + implementations are relatively crude, and might be memory intensive. + - `asarray` no longer accidentally materializes the Dask graph + - `torch` wrappers contain unsigned integer dtypes of widths >8 bits, `uint16`, + `uint32` and `uint64` if PyTorch version is at least 2.3. Note that the + unsigned integer support is incomplete in PyTorch itself, see + [gh-253](https://github.com/data-apis/array-api-compat/pull/253). + +### Authors + +The following users contributed to this release: + +Athan Reines +Guido Imperiale +Evgeni Burovski +Guido Imperiale +Lucas Colley +Ralf Gommers +Thomas Li + + ## 1.10.0 (2024-12-25) ### Major Changes diff --git a/docs/index.md b/docs/index.md index ef18265e..c5c15174 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,8 +12,8 @@ each array library itself fully compatible with the array API, but this requires making backwards incompatible changes in many cases, so this will take some time. -Currently all libraries here are implemented against the [2023.12 -version](https://data-apis.org/array-api/2023.12/) of the standard. +Currently all libraries here are implemented against the [2024.12 +version](https://data-apis.org/array-api/2024.12/) of the standard. ## Installation diff --git a/numpy-1-21-xfails.txt b/numpy-1-21-xfails.txt index c1ef9024..4cdbb735 100644 --- a/numpy-1-21-xfails.txt +++ b/numpy-1-21-xfails.txt @@ -185,3 +185,30 @@ array_api_tests/test_signatures.py::test_func_signature[from_dlpack] array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__] # uint64 repeats not supported array_api_tests/test_manipulation_functions.py::test_repeat + +# 2024.12 support +array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod] + +array_api_tests/test_signatures.py::test_func_signature[bitwise_and] +array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_or] +array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_xor] +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] diff --git a/numpy-1-26-xfails.txt b/numpy-1-26-xfails.txt index db423750..1d991d61 100644 --- a/numpy-1-26-xfails.txt +++ b/numpy-1-26-xfails.txt @@ -39,3 +39,30 @@ array_api_tests/test_signatures.py::test_func_signature[from_dlpack] array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__] # uint64 repeats not supported array_api_tests/test_manipulation_functions.py::test_repeat + +# 2024.12 support +array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod] + +array_api_tests/test_signatures.py::test_func_signature[bitwise_and] +array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_or] +array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_xor] +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] diff --git a/numpy-dev-xfails.txt b/numpy-dev-xfails.txt index e3d3e3b1..eb977bbc 100644 --- a/numpy-dev-xfails.txt +++ b/numpy-dev-xfails.txt @@ -9,3 +9,30 @@ array_api_tests/test_signatures.py::test_extension_func_signature[linalg.vecdot] # 2023.12 support # uint64 repeats not supported array_api_tests/test_manipulation_functions.py::test_repeat + +# 2024.12 support +array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod] + +array_api_tests/test_signatures.py::test_func_signature[bitwise_and] +array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_or] +array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_xor] +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] diff --git a/numpy-xfails.txt b/numpy-xfails.txt index b19568e0..0a0d7472 100644 --- a/numpy-xfails.txt +++ b/numpy-xfails.txt @@ -11,3 +11,31 @@ array_api_tests/test_signatures.py::test_func_signature[from_dlpack] array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__] # uint64 repeats not supported array_api_tests/test_manipulation_functions.py::test_repeat + +# 2024.12 support +array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod] + +array_api_tests/test_signatures.py::test_func_signature[bitwise_and] +array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_or] +array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_xor] +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] + diff --git a/setup.py b/setup.py index 2368ccc4..3d2b68a2 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,5 @@ "Programming Language :: Python :: 3.13", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - ], - package_data={ - "array_api_compat": ["py.typed"], - }, + ] ) diff --git a/test_cupy.sh b/test_cupy.sh index 2e176aa1..a6974333 100755 --- a/test_cupy.sh +++ b/test_cupy.sh @@ -26,5 +26,5 @@ mkdir -p $SCRIPT_DIR/.hypothesis ln -s $SCRIPT_DIR/.hypothesis .hypothesis export ARRAY_API_TESTS_MODULE=array_api_compat.cupy -export ARRAY_API_TESTS_VERSION=2023.12 +export ARRAY_API_TESTS_VERSION=2024.12 pytest array_api_tests/ ${PYTEST_ARGS} --xfails-file $SCRIPT_DIR/cupy-xfails.txt "$@" diff --git a/torch-xfails.txt b/torch-xfails.txt index 915149e8..94d81bef 100644 --- a/torch-xfails.txt +++ b/torch-xfails.txt @@ -123,3 +123,17 @@ array_api_tests/test_signatures.py::test_func_signature[repeat] array_api_tests/test_signatures.py::test_func_signature[from_dlpack] # Argument 'max_version' missing from signature array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__] + + +# 2024.12 support +array_api_tests/test_signatures.py::test_func_signature[bitwise_and] +array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_or] +array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift] +array_api_tests/test_signatures.py::test_func_signature[bitwise_xor] +array_api_tests/test_signatures.py::test_array_method_signature[__and__] +array_api_tests/test_signatures.py::test_array_method_signature[__lshift__] +array_api_tests/test_signatures.py::test_array_method_signature[__or__] +array_api_tests/test_signatures.py::test_array_method_signature[__rshift__] +array_api_tests/test_signatures.py::test_array_method_signature[__xor__] +array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod]