Skip to content

Commit 19f5209

Browse files
authored
Merge pull request #250 from ev-br/release_1.11
Sync the release 1.11 branch
2 parents 61c83fe + eaa58a7 commit 19f5209

20 files changed

+259
-31
lines changed

Diff for: .github/workflows/array-api-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: "! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
7777
env:
7878
ARRAY_API_TESTS_MODULE: array_api_compat.${{ inputs.module-name || inputs.package-name }}
79-
ARRAY_API_TESTS_VERSION: 2023.12
79+
ARRAY_API_TESTS_VERSION: 2024.12
8080
# This enables the NEP 50 type promotion behavior (without it a lot of
8181
# tests fail on bad scalar type promotion behavior)
8282
NPY_PROMOTION_STATE: weak

Diff for: .github/workflows/publish-package.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,25 @@ jobs:
8888
- name: List all files
8989
run: ls -lh dist
9090

91-
- name: Publish distribution 📦 to Test PyPI
92-
# Publish to TestPyPI on tag events of if manually triggered
93-
# Compare to 'true' string as booleans get turned into strings in the console
94-
if: >-
95-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
96-
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')
91+
# - name: Publish distribution 📦 to Test PyPI
92+
# # Publish to TestPyPI on tag events of if manually triggered
93+
# # Compare to 'true' string as booleans get turned into strings in the console
94+
# if: >-
95+
# (github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
96+
# || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')
97+
# uses: pypa/[email protected]
98+
# with:
99+
# repository-url: https://test.pypi.org/legacy/
100+
# print-hash: true
101+
102+
- name: Publish distribution 📦 to PyPI
103+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
97104
uses: pypa/[email protected]
98105
with:
99-
repository-url: https://test.pypi.org/legacy/
100106
print-hash: true
101107

102108
- name: Create GitHub Release from a Tag
103109
uses: softprops/action-gh-release@v2
104110
if: startsWith(github.ref, 'refs/tags/')
105111
with:
106112
files: dist/*
107-
108-
- name: Publish distribution 📦 to PyPI
109-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
110-
uses: pypa/[email protected]
111-
with:
112-
print-hash: true

Diff for: array_api_compat/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
this implementation for the default when working with NumPy arrays.
1818
1919
"""
20-
__version__ = '1.10.1.dev0'
20+
__version__ = '1.11'
2121

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

Diff for: array_api_compat/common/_helpers.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,11 @@ def is_array_api_strict_namespace(xp) -> bool:
432432

433433

434434
def _check_api_version(api_version: str) -> None:
435-
if api_version in ['2021.12', '2022.12']:
436-
warnings.warn(f"The {api_version} version of the array API specification was requested but the returned namespace is actually version 2023.12")
435+
if api_version in ['2021.12', '2022.12', '2023.12']:
436+
warnings.warn(f"The {api_version} version of the array API specification was requested but the returned namespace is actually version 2024.12")
437437
elif api_version is not None and api_version not in ['2021.12', '2022.12',
438-
'2023.12']:
439-
raise ValueError("Only the 2023.12 version of the array API specification is currently supported")
438+
'2023.12', '2024.12']:
439+
raise ValueError("Only the 2024.12 version of the array API specification is currently supported")
440440

441441

442442
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:
451451
452452
api_version: str
453453
The newest version of the spec that you need support for (currently
454-
the compat library wrapped APIs support v2023.12).
454+
the compat library wrapped APIs support v2024.12).
455455
456456
use_compat: bool or None
457457
If None (the default), the native namespace will be returned if it is

Diff for: array_api_compat/cupy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

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

16-
__array_api_version__ = '2023.12'
16+
__array_api_version__ = '2024.12'

Diff for: array_api_compat/dask/array/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# These imports may overwrite names from the import * above.
44
from ._aliases import * # noqa: F403
55

6-
__array_api_version__ = '2023.12'
6+
__array_api_version__ = '2024.12'
77

88
__import__(__package__ + '.linalg')
99
__import__(__package__ + '.fft')

Diff for: array_api_compat/numpy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
except ImportError:
2828
pass
2929

30-
__array_api_version__ = '2023.12'
30+
__array_api_version__ = '2024.12'

Diff for: array_api_compat/py.typed

Whitespace-only changes.

Diff for: array_api_compat/torch/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121

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

24-
__array_api_version__ = '2023.12'
24+
__array_api_version__ = '2024.12'

Diff for: cupy-xfails.txt

+11
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,14 @@ array_api_tests/test_fft.py::test_irfftn
182182
array_api_tests/test_manipulation_functions.py::test_repeat
183183
array_api_tests/test_signatures.py::test_func_signature[from_dlpack]
184184
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__]
185+
186+
+# 2024.12 support
187+
array_api_tests/test_signatures.py::test_func_signature[count_nonzero]
188+
array_api_tests/test_signatures.py::test_func_signature[bitwise_and]
189+
array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift]
190+
array_api_tests/test_signatures.py::test_func_signature[bitwise_or]
191+
array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift]
192+
array_api_tests/test_signatures.py::test_func_signature[bitwise_xor]
193+
array_api_tests/test_special_cases.py::test_binary[nextafter(x1_i is +0 and x2_i is -0) -> -0]
194+
array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod]
195+

Diff for: dask-xfails.txt

+42
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,45 @@ array_api_tests/test_creation_functions.py::test_arange
9191

9292
# 2023.12 support
9393
array_api_tests/test_manipulation_functions.py::test_repeat
94+
95+
# 2024.12 support
96+
array_api_tests/test_array_object.py::test_setitem
97+
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_1[1]
98+
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_1[None]
99+
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_2[1]
100+
array_api_tests/test_array_object.py::test_getitem_arrays_and_ints_2[None]
101+
array_api_tests/test_has_names.py::test_has_names[indexing-take_along_axis]
102+
array_api_tests/test_signatures.py::test_func_signature[take_along_axis]
103+
104+
array_api_tests/test_linalg.py::test_cholesky
105+
array_api_tests/test_linalg.py::test_linalg_matmul
106+
array_api_tests/test_linalg.py::test_matrix_norm
107+
array_api_tests/test_linalg.py::test_qr
108+
array_api_tests/test_manipulation_functions.py::test_concat
109+
array_api_tests/test_manipulation_functions.py::test_roll
110+
array_api_tests/test_operators_and_elementwise_functions.py::test_add[add(x1, x2)]
111+
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_left_shift[bitwise_left_shift(x1, x2)]
112+
array_api_tests/test_operators_and_elementwise_functions.py::test_bitwise_right_shift[bitwise_right_shift(x1, x2)]
113+
array_api_tests/test_operators_and_elementwise_functions.py::test_greater[__gt__(x1, x2)]
114+
array_api_tests/test_signatures.py::test_func_signature[count_nonzero]
115+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
116+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
117+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
118+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
119+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
120+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
121+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
122+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
123+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
124+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
125+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
126+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
127+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
128+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
129+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
130+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
131+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
132+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
133+
array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod]
134+
135+

Diff for: docs/changelog.md

+55
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
# Changelog
22

3+
## 1.11.0 (2025-XX-XX)
4+
5+
### Major Changes
6+
7+
This release targets the 2024.12 Array API revision. This includes
8+
9+
- `__array_api_version__` for the wrapped APIs is now set to `2024.12`;
10+
- Wrappers for `count_nonzero`;
11+
- Wrappers for `cumulative_prod`;
12+
- Wrappers for `take_along_axis` (with the exception of Dask);
13+
- Wrappers for `diff`;
14+
- `__capabilities__` dict contains a `max_dimensions` key;
15+
- Python scalars are accepted as arguments to `result_type`;
16+
- `fft.fftfreq` and `fft.rfftfreq` functions now accept an optional `dtype`
17+
argument to control the output data type.
18+
19+
Note that these wrappers, as well as other 2024.12 features, are relatively undertested
20+
in this release, and may have rough edges. Please report any issues you encounter
21+
in [the issue tracker](https://github.com/data-apis/array-api-compat/issues).
22+
23+
New functions to test properties of arrays:
24+
- `is_writeable_array` (benefits NumPy, JAX, Sparse)
25+
- `is_lazy_array` (benefits JAX, Dask, ndonnx)
26+
27+
Improved support for JAX:
28+
- Work arounds for `.device` attribute and `to_device` function
29+
not working correctly within `jax.jit`
30+
31+
### Minor Changes
32+
33+
- Several improvements to `dask.array` wrappers:
34+
35+
- `size` returns None for arrays of unknown shapes.
36+
- `astype(..., copy=True)` always copies, independently of the Dask version.
37+
- implementations of `sort` and `argsort` are now available. Note that these
38+
implementations are relatively crude, and might be memory intensive.
39+
- `asarray` no longer accidentally materializes the Dask graph
40+
- `torch` wrappers contain unsigned integer dtypes of widths >8 bits, `uint16`,
41+
`uint32` and `uint64` if PyTorch version is at least 2.3. Note that the
42+
unsigned integer support is incomplete in PyTorch itself, see
43+
[gh-253](https://github.com/data-apis/array-api-compat/pull/253).
44+
45+
### Authors
46+
47+
The following users contributed to this release:
48+
49+
Athan Reines
50+
Guido Imperiale
51+
Evgeni Burovski
52+
Guido Imperiale
53+
Lucas Colley
54+
Ralf Gommers
55+
Thomas Li
56+
57+
358
## 1.10.0 (2024-12-25)
459

560
### Major Changes

Diff for: docs/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ each array library itself fully compatible with the array API, but this
1212
requires making backwards incompatible changes in many cases, so this will
1313
take some time.
1414

15-
Currently all libraries here are implemented against the [2023.12
16-
version](https://data-apis.org/array-api/2023.12/) of the standard.
15+
Currently all libraries here are implemented against the [2024.12
16+
version](https://data-apis.org/array-api/2024.12/) of the standard.
1717

1818
## Installation
1919

Diff for: numpy-1-21-xfails.txt

+27
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,30 @@ array_api_tests/test_signatures.py::test_func_signature[from_dlpack]
185185
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__]
186186
# uint64 repeats not supported
187187
array_api_tests/test_manipulation_functions.py::test_repeat
188+
189+
# 2024.12 support
190+
array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod]
191+
192+
array_api_tests/test_signatures.py::test_func_signature[bitwise_and]
193+
array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift]
194+
array_api_tests/test_signatures.py::test_func_signature[bitwise_or]
195+
array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift]
196+
array_api_tests/test_signatures.py::test_func_signature[bitwise_xor]
197+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
198+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
199+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
200+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
201+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
202+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
203+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
204+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
205+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
206+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
207+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
208+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
209+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
210+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
211+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
212+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
213+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
214+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]

Diff for: numpy-1-26-xfails.txt

+27
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,30 @@ array_api_tests/test_signatures.py::test_func_signature[from_dlpack]
3939
array_api_tests/test_signatures.py::test_array_method_signature[__dlpack__]
4040
# uint64 repeats not supported
4141
array_api_tests/test_manipulation_functions.py::test_repeat
42+
43+
# 2024.12 support
44+
array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod]
45+
46+
array_api_tests/test_signatures.py::test_func_signature[bitwise_and]
47+
array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift]
48+
array_api_tests/test_signatures.py::test_func_signature[bitwise_or]
49+
array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift]
50+
array_api_tests/test_signatures.py::test_func_signature[bitwise_xor]
51+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
52+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
53+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
54+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
55+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
56+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
57+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
58+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
59+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
60+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
61+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
62+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
63+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
64+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
65+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
66+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
67+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
68+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]

0 commit comments

Comments
 (0)