Skip to content

Commit 916a84b

Browse files
authored
Merge pull request #81 from asmeurer/release
1.4.1 release
2 parents 7ab1879 + ad2d852 commit 916a84b

12 files changed

+210
-125
lines changed

Diff for: CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# 1.4.1 (2024-01-18)
2+
3+
## Minor Changes
4+
5+
- Add support for the upcoming NumPy 2.0 release.
6+
7+
- Added a torch wrapper for `trace` (`torch.trace` doesn't support the
8+
`offset` argument or stacking)
9+
10+
- Wrap numpy, cupy, and torch `nonzero` to raise an error for zero-dimensional
11+
input arrays.
12+
13+
- Add torch wrapper for `newaxis`.
14+
15+
- Improve error message for `array_namespace`
16+
17+
- Fix linalg.cholesky returning the conjugate of the expected upper
18+
decomposition for numpy and cupy.
19+
120
# 1.4 (2023-09-13)
221

322
## Major Changes

Diff for: README.md

+51
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,54 @@ corresponding document does not yet exist for PyTorch, but you can examine the
300300
various comments in the
301301
[implementation](https://github.com/data-apis/array-api-compat/blob/main/array_api_compat/torch/_aliases.py)
302302
to see what functions and behaviors have been wrapped.
303+
304+
305+
## Releasing
306+
307+
To release, first note that CuPy must be tested manually (it isn't tested on
308+
CI). Use the script
309+
310+
```
311+
./test_cupy.sh
312+
```
313+
314+
on a machine with a CUDA GPU.
315+
316+
Once you are ready to release, create a PR with a release branch, so that you
317+
can verify that CI is passing. You must edit
318+
319+
```
320+
array_api_compat/__init__.py
321+
```
322+
323+
and update the version (the version is not computed from the tag because that
324+
would break vendorability). You should also edit
325+
326+
```
327+
CHANGELOG.md
328+
```
329+
330+
with the changes for the release.
331+
332+
Then create a tag
333+
334+
```
335+
git tag -a <version>
336+
```
337+
338+
and push it to GitHub
339+
340+
```
341+
git push origin <version>
342+
```
343+
344+
Check that the `publish distributions` action works. Note that this action
345+
will run even if the other CI fails, so you must make sure that CI is passing
346+
*before* tagging.
347+
348+
This does mean you can ignore CI failures, but ideally you should fix any
349+
failures or update the `*-xfails.txt` files before tagging, so that CI and the
350+
cupy tests pass. Otherwise it will be hard to tell what things are breaking in
351+
the future. It's also a good idea to remove any xpasses from those files (but
352+
be aware that some xfails are from flaky failures, so unless you know the
353+
underlying issue has been fixed, a xpass test is probably still xfail).

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'
20+
__version__ = '1.4.1'
2121

2222
from .common import *

Diff for: array_api_compat/cupy/_aliases.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,17 @@
6161
matmul = get_xp(cp)(_aliases.matmul)
6262
matrix_transpose = get_xp(cp)(_aliases.matrix_transpose)
6363
tensordot = get_xp(cp)(_aliases.tensordot)
64-
vecdot = get_xp(cp)(_aliases.vecdot)
65-
isdtype = get_xp(cp)(_aliases.isdtype)
64+
65+
# These functions are completely new here. If the library already has them
66+
# (i.e., numpy 2.0), use the library version instead of our wrapper.
67+
if hasattr(cp, 'vecdot'):
68+
vecdot = cp.vecdot
69+
else:
70+
vecdot = get_xp(cp)(_aliases.vecdot)
71+
if hasattr(cp, 'isdtype'):
72+
isdtype = cp.isdtype
73+
else:
74+
isdtype = get_xp(cp)(_aliases.isdtype)
6675

6776
__all__ = _aliases.__all__ + ['asarray', 'asarray_cupy', 'bool', 'acos',
6877
'acosh', 'asin', 'asinh', 'atan', 'atan2',

Diff for: array_api_compat/cupy/linalg.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@
2929
pinv = get_xp(cp)(_linalg.pinv)
3030
matrix_norm = get_xp(cp)(_linalg.matrix_norm)
3131
svdvals = get_xp(cp)(_linalg.svdvals)
32-
vector_norm = get_xp(cp)(_linalg.vector_norm)
3332
diagonal = get_xp(cp)(_linalg.diagonal)
3433
trace = get_xp(cp)(_linalg.trace)
3534

35+
# These functions are completely new here. If the library already has them
36+
# (i.e., numpy 2.0), use the library version instead of our wrapper.
37+
if hasattr(cp.linalg, 'vector_norm'):
38+
vector_norm = cp.linalg.vector_norm
39+
else:
40+
vector_norm = get_xp(cp)(_linalg.vector_norm)
41+
3642
__all__ = linalg_all + _linalg.__all__
3743

3844
del get_xp

Diff for: array_api_compat/numpy/_aliases.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,17 @@
6161
matmul = get_xp(np)(_aliases.matmul)
6262
matrix_transpose = get_xp(np)(_aliases.matrix_transpose)
6363
tensordot = get_xp(np)(_aliases.tensordot)
64-
vecdot = get_xp(np)(_aliases.vecdot)
65-
isdtype = get_xp(np)(_aliases.isdtype)
64+
65+
# These functions are completely new here. If the library already has them
66+
# (i.e., numpy 2.0), use the library version instead of our wrapper.
67+
if hasattr(np, 'vecdot'):
68+
vecdot = np.vecdot
69+
else:
70+
vecdot = get_xp(np)(_aliases.vecdot)
71+
if hasattr(np, 'isdtype'):
72+
isdtype = np.isdtype
73+
else:
74+
isdtype = get_xp(np)(_aliases.isdtype)
6675

6776
__all__ = _aliases.__all__ + ['asarray', 'asarray_numpy', 'bool', 'acos',
6877
'acosh', 'asin', 'asinh', 'atan', 'atan2',

Diff for: array_api_compat/numpy/linalg.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@
2222
pinv = get_xp(np)(_linalg.pinv)
2323
matrix_norm = get_xp(np)(_linalg.matrix_norm)
2424
svdvals = get_xp(np)(_linalg.svdvals)
25-
vector_norm = get_xp(np)(_linalg.vector_norm)
2625
diagonal = get_xp(np)(_linalg.diagonal)
2726
trace = get_xp(np)(_linalg.trace)
2827

28+
# These functions are completely new here. If the library already has them
29+
# (i.e., numpy 2.0), use the library version instead of our wrapper.
30+
if hasattr(np.linalg, 'vector_norm'):
31+
vector_norm = np.linalg.vector_norm
32+
else:
33+
vector_norm = get_xp(np)(_linalg.vector_norm)
34+
2935
__all__ = linalg_all + _linalg.__all__
3036

3137
del get_xp

0 commit comments

Comments
 (0)