You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/array_api_v2024_release.md
+62-16
Original file line number
Diff line number
Diff line change
@@ -9,49 +9,95 @@ draft = false
9
9
weight = 30
10
10
+++
11
11
12
-
Another year, another milestone! We're excited to announce the release of the 2024 revision of the Array API Standard, the latest iteration of our ongoing efforts to unify and standardize array programming across the PyData ecosystem. Since the standard's inception, our goal has been to facilitate interoperability between array libraries and enable a more consistent and predictable developer experience. This year's update continues that mission with key enhancements, new features, and clarifications that reflect the needs of the community.
12
+
Another year, another milestone! We're excited to announce the release of the
13
+
2024 revision of the Array API Standard, the latest iteration of our ongoing
14
+
efforts to unify and standardize array programming across the PyData ecosystem.
15
+
Since the standard's inception, our goal has been to facilitate
16
+
interoperability between array libraries and enable a more consistent and
17
+
predictable developer experience. This year's update continues that mission
18
+
with key enhancements, new features, and clarifications that reflect the needs
19
+
of the community.
13
20
14
21
## Key Enhancements in 2024.12
15
22
16
23
### Scalar Argument Support
17
24
18
-
Previously, binary element-wise functions, such as `add`, `mul`, and others, required both input arguments to be arrays. This constraint has now been relaxed: scalars are now allowed as arguments, as long as at least one argument is an array. This change aligns with common practices in numerical computing and makes it easier to write concise, readable code.
25
+
Previously, binary element-wise functions, such as `add`, `mul`, and others,
26
+
required both input arguments to be arrays. This constraint has now been
27
+
relaxed: scalars are now allowed as arguments, as long as at least one argument
28
+
is an array. This change aligns with common practices in numerical computing
29
+
workflows and makes it easier to write concise, readable code.
19
30
20
31
### Integer Array Indexing
21
32
22
-
Portable indexing semantics just got more powerful! The 2024 revision of the standard introduces support for indexing an array using tuples consisting solely of integers and integer arrays. This feature—a subset of NumPy's vectorized fancy indexing—was a highly requested addition from downstream users. It enables efficient random sampling and more flexible multi-dimensional indexing, making it easier to work with large datasets and tensors.
33
+
Portable indexing semantics just got more powerful! The 2024 revision of the
34
+
standard introduces support for indexing an array using tuples consisting
35
+
solely of integers and integer arrays. This feature—a subset of NumPy's
36
+
vectorized fancy indexing—was a highly requested addition from downstream
37
+
users. It enables efficient random sampling and more flexible multi-dimensional
38
+
indexing, making it easier to work with large datasets and tensors.
23
39
24
-
For more details, see [_Integer Array Indexing_](https://data-apis.org/array-api/latest/API_specification/indexing.html#integer-array-indexing) in the specification.
40
+
For more details, see [_Integer Array Indexing_](https://data-apis.org/array-api/latest/API_specification/indexing.html#integer-array-indexing)
41
+
in the specification.
25
42
26
43
### New API Additions
27
44
28
-
Several new APIs have been introduced in this release to expand functionality and improve usability:
45
+
Several new APIs have been introduced in this release to expand functionality
46
+
and improve usability:
29
47
30
48
-`count_nonzero`: counts the number of nonzero elements in an array.
31
49
-`cumulative_prod`: computes the cumulative product along a specified axis.
32
-
-`take_along_axis`: selects elements from an array using indices along a given axis.
50
+
-`take_along_axis`: selects elements from an array using indices along a
51
+
given axis.
33
52
-`diff`: computes the discrete difference between consecutive elements.
34
-
-`nextafter`: returns the next representable floating-point value in the direction of another floating-point value.
53
+
-`nextafter`: returns the next representable floating-point value in the
54
+
direction of another floating-point value.
35
55
36
-
These additions further close the gap between the Array API Standard and established numerical computing libraries.
56
+
These additions further close the gap between the Array API Standard and
57
+
established numerical computing libraries.
37
58
38
59
### Breaking Changes
39
60
40
-
With progress comes necessary refinements. This year's update includes two significant breaking changes:
41
-
42
-
-**Device-aware type promotion**: The guidance for `result_type` and `can_cast` has been updated to require that type promotion rules account for device contexts when at least one operand is an array. This ensures that type promotion can be correctly handled across different hardware environments and accurately reflect device capabilities.
43
-
-**Refined handling of Python complex scalars**: Previously, for binary operations involving an array and a Python scalar, the standard required that all scalar values be automatically converted to zero-dimensional arrays of the same type as the array operand. Now, if a Python `complex` scalar is used in an operation (e.g., `x * 1j`), the real-valued array operand should be promoted to a complex floating-point type of the same precision as the original array operand. This change better aligns with practical use cases involving complex numbers and helps improve developer ergonomics.
61
+
With progress comes necessary refinements. This year's update includes two
62
+
significant breaking changes:
63
+
64
+
-**Device-aware type promotion**: The guidance for `result_type` and `can_cast`
65
+
has been updated to require that type promotion rules account for device
66
+
contexts when at least one operand is an array. This ensures that type
67
+
promotion can be correctly handled across different hardware environments
68
+
and accurately reflect device capabilities.
69
+
-**Refined handling of Python complex scalars**: Previously, for binary
70
+
operations involving an array and a Python scalar, the standard required
71
+
that all scalar values be automatically converted to zero-dimensional
72
+
arrays of the same type as the array operand. Now, if a Python `complex`
73
+
scalar is used in an operation (e.g., `x * 1j`), the real-valued array
74
+
operand should be promoted to a complex floating-point type of the same
75
+
precision as the original array operand. This change better aligns with
76
+
practical use cases involving complex numbers and helps improve developer
77
+
ergonomics.
44
78
45
79
### Specification Clarifications
46
80
47
-
Standards evolve not just through feature additions but also through refinements. Over the past year, we've worked closely with implementers and downstream users to resolve ambiguities in the specification. These clarifications ensure that adopting the standard is as seamless as possible and that behavior is well-defined across implementations.
81
+
Standards evolve not just through feature additions but also through
82
+
refinements. Over the past year, we've worked closely with implementers and
83
+
downstream users to resolve ambiguities in the specification. These
84
+
clarifications ensure that adopting the standard is as seamless as possible and
85
+
that behavior is well-defined across implementations.
48
86
49
87
## Looking Ahead
50
88
51
-
The 2024 revision of the Array API Standard represents another step forward in making array interoperability a reality across the Python ecosystem. Every iteration of the standard reflects deep collaboration across the PyData community, with contributions from library maintainers, researchers, and practitioners.
89
+
The 2024 revision of the Array API Standard represents another step forward in
90
+
making array interoperability a reality across the Python ecosystem. Every
91
+
iteration of the standard reflects deep collaboration across the PyData
92
+
community, with contributions from library maintainers, researchers, and
93
+
practitioners.
52
94
53
-
We encourage all implementers to adopt the latest version and welcome feedback from the community. If you're interested in contributing to future discussions, check out the [specification repository](https://github.com/data-apis/array-api) and get involved!
95
+
We encourage all implementers to adopt the latest version and welcome feedback
96
+
from the community. If you're interested in contributing to future discussions,
97
+
check out the [specification repository](https://github.com/data-apis/array-api)
98
+
and get involved!
54
99
55
100
For full details on this release, see the [changelog](https://data-apis.org/array-api/latest/changelog.html#v2024-12).
56
101
57
-
Here's to another year of advancing the frontier of array and tensor computing in Python!
102
+
Here's to another year of advancing the frontier of array and tensor computing
0 commit comments