Skip to content

Commit d10bf57

Browse files
authored
Merge pull request #100 from asmeurer/release
1.5 release
2 parents 2ec2dce + 6222279 commit d10bf57

File tree

6 files changed

+85
-23
lines changed

6 files changed

+85
-23
lines changed

Diff for: CHANGELOG.md

+65-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
1-
# 1.4.1 (2024-01-18)
1+
# Array API Compat Changelog
22

3-
## Minor Changes
3+
## 1.5 (2024-03-07)
4+
5+
### Major Changes
6+
7+
- Add support for Dask ([@lithomas1](https://github.com/lithomas1)).
8+
9+
- Add support for JAX. Note that unlike other array libraries,
10+
array-api-compat does not contain any wrappers for JAX functions. All JAX
11+
array API support is in JAX itself. Thus, there is no `array_api_compat.jax`
12+
submodule, and `array_namespace(<JAX array>)` returns the
13+
`jax.experimental.array_api` module.
14+
15+
- The functions `is_numpy_array(x)`, `is_cupy_array(x)`, `is_torch_array(x)`,
16+
`is_dask_array(x)`, `is_jax_array(x)` are now part of the public
17+
`array_api_compat` API.
18+
19+
- Add wrappers for the `fft` extension module for NumPy, CuPy, and PyTorch.
20+
21+
### Minor Changes
22+
23+
- Allow `'2022.12'` as the `api_version` in `array_namespace()`. `'2021.12'`
24+
is also supported but will issue a warning since the returned namespace will
25+
still be a 2022.12 compliant one.
26+
27+
- Add wrapper for numpy.linalg.solve, which broadcasts the inputs according to
28+
the standard.
29+
30+
- Add wrappers for various PyTorch linalg functions.
31+
32+
- Fix a bug with `numpy.linalg.vector_norm(keepdims=True)`.
33+
34+
- BREAKING: Update `vecdot` wrappers to apply `axes` before broadcasting, not
35+
after. This matches the updated 2023.12 standard wording, and also the
36+
behavior of the new `numpy.vecdot` gufunc in NumPy 2.0.
37+
38+
- Fix some linalg functions which were supposed to be in both the main
39+
namespace and the linalg extension namespace.
40+
41+
- Add Ruff to CI. ([@adonath](https://github.com/adonath))
42+
43+
- Test that internal definitions of `__all__` are self-consistent, which
44+
should help to avoid issues where wrappers are accidentally not exported to
45+
the compat namespaces properly.
46+
47+
## 1.4.1 (2024-01-18)
48+
49+
### Minor Changes
450

551
- Add support for the upcoming NumPy 2.0 release.
652

@@ -17,14 +63,14 @@
1763
- Fix linalg.cholesky returning the conjugate of the expected upper
1864
decomposition for numpy and cupy.
1965

20-
# 1.4 (2023-09-13)
66+
## 1.4 (2023-09-13)
2167

22-
## Major Changes
68+
### Major Changes
2369

2470
- Releases are now made with GitHub Actions (thanks
2571
[@matthewfeickert](https://github.com/matthewfeickert)).
2672

27-
## Minor Changes
73+
### Minor Changes
2874

2975
- Fix `torch.result_type()` cross-kind promotion
3076
([@lucascolley](https://github.com/lucascolley)).
@@ -34,42 +80,42 @@
3480
- Add requires-python metadata to the package
3581
([@matthewfeickert](https://github.com/matthewfeickert)).
3682

37-
# 1.3 (2023-06-20)
83+
## 1.3 (2023-06-20)
3884

39-
## Major Changes
85+
### Major Changes
4086

4187
- Add [2022.12](https://data-apis.org/array-api/2022.12/) standard support.
4288
This includes things like adding complex dtype support, adding the new
4389
`take` function, and various minor changes in the specification.
4490

45-
## Minor Changes
91+
### Minor Changes
4692

4793
- Support `"cpu"` in CuPy `to_device()`.
4894

4995
- Return a new array in NumPy/CuPy `reshape(copy=False)`.
5096

5197
- Fix signatures for PyTorch `broadcast_to` and `permute_dims`.
5298

53-
# 1.2 (2023-04-03)
99+
## 1.2 (2023-04-03)
54100

55-
## Major Changes
101+
### Major Changes
56102

57103
- Support the linalg extension in the `array_api_compat.torch` namespace.
58104

59105
- Add `isdtype()`.
60106

61-
## Minor Changes
107+
### Minor Changes
62108

63109
- Fix the `k` keyword argument to `tril` and `triu` in `torch`.
64110

65-
# 1.1.1 (2023-03-10)
111+
## 1.1.1 (2023-03-10)
66112

67-
## Major Changes
113+
### Major Changes
68114

69115
- Rename `get_namespace()` to `array_namespace()` (`get_namespace()` is
70116
maintained as a backwards compatible alias).
71117

72-
## Minor Changes
118+
### Minor Changes
73119

74120
- The minimum supported NumPy version is now 1.21. Fixed a few issues with
75121
NumPy 1.21 (with `unique_*` and `asarray`), although there are also a few
@@ -91,9 +137,9 @@
91137
- Add `torch` wrappers for `ones`, `empty`, and `zeros` so that `shape` can be
92138
passed as a keyword argument.
93139

94-
# 1.1 (2023-02-24)
140+
## 1.1 (2023-02-24)
95141

96-
## Major Changes
142+
### Major Changes
97143

98144
- Added support for PyTorch.
99145

@@ -104,14 +150,14 @@
104150
- All wrapper functions that wrap existing library functions now pass through
105151
arbitrary `**kwargs`.
106152

107-
## Minor Changes
153+
### Minor Changes
108154

109155
- Added CI to run against the [array API testsuite](https://github.com/data-apis/array-api-tests).
110156

111157
- Fix `sort(stable=False)` and `argsort(stable=False)` with CuPy.
112158

113-
# 1.0 (2022-12-05)
159+
## 1.0 (2022-12-05)
114160

115-
## Major Changes
161+
### Major Changes
116162

117163
- Initial release. Includes support for NumPy and CuPy.

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.4.1'
20+
__version__ = '1.5'
2121

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

Diff for: array_api_compat/common/_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,4 @@ def size(x):
325325
"to_device",
326326
]
327327

328-
_all_ignore = ['sys', 'math', 'inspect']
328+
_all_ignore = ['sys', 'math', 'inspect', 'warnings']

Diff for: cupy-xfails.txt

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ array_api_tests/test_searching_functions.py::test_argmin
4444
array_api_tests/test_statistical_functions.py::test_min
4545
array_api_tests/test_statistical_functions.py::test_max
4646

47+
# prod() sometimes doesn't give nan for 0*overflow
48+
array_api_tests/test_statistical_functions.py::test_prod
49+
4750
# testsuite incorrectly thinks meshgrid doesn't have indexing argument
4851
# (https://github.com/data-apis/array-api-tests/issues/171)
4952
array_api_tests/test_signatures.py::test_func_signature[meshgrid]

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

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__trued
122122
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[__truediv__(x1, x2)]
123123
array_api_tests/test_operators_and_elementwise_functions.py::test_divide[divide(x1, x2)]
124124
array_api_tests/test_operators_and_elementwise_functions.py::test_equal[equal(x1, x2)]
125+
array_api_tests/test_operators_and_elementwise_functions.py::test_equal[__eq__(x1, x2)]
125126
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__floordiv__(x, s)]
126127
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__floordiv__(x1, x2)]
127128
array_api_tests/test_operators_and_elementwise_functions.py::test_floor_divide[__ifloordiv__(x, s)]

Diff for: tests/test_array_namespace.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import subprocess
22
import sys
3+
import warnings
34

45
import numpy as np
56
import pytest
@@ -57,13 +58,24 @@ def test_array_namespace_errors():
5758
pytest.raises(TypeError, lambda: array_namespace((x, x)))
5859
pytest.raises(TypeError, lambda: array_namespace(x, (x, x)))
5960

60-
6161
def test_array_namespace_errors_torch():
6262
y = torch.asarray([1, 2])
6363
x = np.asarray([1, 2])
6464
pytest.raises(TypeError, lambda: array_namespace(x, y))
65-
pytest.raises(ValueError, lambda: array_namespace(x, api_version="2022.12"))
6665

66+
def test_api_version():
67+
x = np.asarray([1, 2])
68+
np_ = import_("numpy", wrapper=True)
69+
assert array_namespace(x, api_version="2022.12") == np_
70+
assert array_namespace(x, api_version=None) == np_
71+
assert array_namespace(x) == np_
72+
# Should issue a warning
73+
with warnings.catch_warnings(record=True) as w:
74+
assert array_namespace(x, api_version="2021.12") == np_
75+
assert len(w) == 1
76+
assert "2021.12" in str(w[0].message)
77+
78+
pytest.raises(ValueError, lambda: array_namespace(x, api_version="2020.12"))
6779

6880
def test_get_namespace():
6981
# Backwards compatible wrapper

0 commit comments

Comments
 (0)