Skip to content

release 1.11 branch #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/array-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,25 @@ 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/[email protected]
# 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/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
print-hash: true

- name: Create GitHub Release from a Tag
uses: softprops/action-gh-release@v2
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/[email protected]
with:
print-hash: true
2 changes: 1 addition & 1 deletion array_api_compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions array_api_compat/common/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion array_api_compat/cupy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

from ..common._helpers import * # noqa: F401,F403

__array_api_version__ = '2023.12'
__array_api_version__ = '2024.12'
2 changes: 1 addition & 1 deletion array_api_compat/dask/array/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
2 changes: 1 addition & 1 deletion array_api_compat/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
except ImportError:
pass

__array_api_version__ = '2023.12'
__array_api_version__ = '2024.12'
Empty file removed array_api_compat/py.typed
Empty file.
2 changes: 1 addition & 1 deletion array_api_compat/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

from ..common._helpers import * # noqa: F403

__array_api_version__ = '2023.12'
__array_api_version__ = '2024.12'
11 changes: 11 additions & 0 deletions cupy-xfails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]

42 changes: 42 additions & 0 deletions dask-xfails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]


55 changes: 55 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 27 additions & 0 deletions numpy-1-21-xfails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
27 changes: 27 additions & 0 deletions numpy-1-26-xfails.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Loading
Loading