33# Migration Guide
44
55This page is meant to help migrate your codebase to an array API standard
6- compliant implementation. The guide is divided into three parts.
6+ compliant implementation or become interoperable with compliant
7+ implementations. The guide is divided into three parts.
78
89The first part gives an overview of the {ref}` ecosystem ` libraries, that
910are helpful in different contexts when working with the array API standard.
1011
11- The first part is dedicated for {ref}` array-producers ` . If your library
12+ The second part is dedicated to {ref}` array-producers ` . If your library
1213mimics, for example, NumPy's or PyTorch's functionality, then you can find in
13- the first part additional instructions and guidance on how to ensure
14- downstream users can easily pick your solution as an array provider for
15- their system/algorithm.
14+ here additional instructions and guidance on how to ensure downstream users
15+ can easily pick your solution as an array provider for their system/algorithm.
1616
17- The second part delves into details for array API standard compatibility for
17+ The third part delves into details for array API standard compatibility for
1818{ref}` array-consumers ` . This pertains to any software that performs
1919multidimensional array manipulation in Python, such as may be found in
2020scikit-learn, SciPy, or statsmodels. If your software relies on a certain
2121array producing library, such as NumPy or JAX, then you can use the second
22- part to learn how to make it library agnostic and, as a result, interchange
23- array namespaces with significantly less friction.
22+ part to learn how to make it library agnostic and, as a result, use array
23+ namespaces interchangeably with significantly less friction.
2424
2525
2626(ecosystem)=
@@ -39,12 +39,13 @@ GitHub: [array-api-compat](https://github.com/data-apis/array-api-compat)
3939
4040User group: Array Consumers
4141
42- Although NumPy, Dask, CuPy, and PyTorch support the array API standard, there
43- are still some corner cases where their behavior diverges from the standard.
42+ Although NumPy or CuPy support the array API standard, there are still some
43+ corner cases where their behavior diverges from the standard.
4444` array-api-compat ` provides a compatibility layer to cover an additional subset
45- of these corner cases. This is also accompanied by a few utility functions fo
46- easier introspection into array objects. As an array consumer, you can still
47- rely on the original API while having access to the standard compatible one.
45+ of such corner cases for supported libraries. This is also accompanied by a few
46+ utility functions for easier introspection into array objects. As an array
47+ consumer, you can consume standard-compliant namespaces as well as the wrapped
48+ namespaces in ` array-api-compat ` at the same time.
4849
4950
5051(array-api-strict)=
@@ -57,8 +58,8 @@ User group: Array Consumers
5758
5859` array-api-strict ` is a library that provides a strict and minimal
5960implementation of the array API standard. As a consumer, you can use
60- ` array-api-strict ` for parametrising tests with it as an array namespace
61- to ensure your code uses APIs compliant with the standard.
61+ ` array-api-strict ` in parametrising tests over the array namespace
62+ to ensure your code uses only APIs compliant which are in the standard.
6263
6364
6465(array-api-tests)=
@@ -181,7 +182,7 @@ return np.dot(c, b)
181182The first step should be as simple as assigning the ` np ` namespace to a dedicated
182183namespace variable. The convention used in the ecosystem is to name it ` xp ` .
183184Then, it is vital to ensure that each method and function call is something that
184- the array API standard supports. For example, ` dot ` is present in the NumPy's
185+ the array API standard supports. For example, ` dot ` is present in the NumPy
185186API, but the standard doesn't support it. For the sake of simplicity, let's
186187assume both ` c ` and ` b ` are ` ndim=2 ` ; therefore, we select ` tensordot ` instead,
187188as both NumPy and the standard define it:
0 commit comments