40
40
[ on conda-forge] ( https://prefix.dev/channels/conda-forge/packages/array-api-extra ) :
41
41
42
42
``` shell
43
- micromamba install -c https://repo.prefix.dev/conda-forge array-api-extra
43
+ mamba install array-api-extra
44
44
# or
45
45
pixi add array-api-extra
46
46
```
@@ -122,9 +122,12 @@ return xpx.atleast_nd(y, ndim=2, xp=xp)
122
122
123
123
``` {note}
124
124
Functions in this library assume input arrays *are arrays* (not "array-likes") and that
125
- the namespace passed as `xp` is compatible with the standard. This means that
126
- the namespace you pass as `xp` should come from array-api-compat's `` array_namespace` `,
125
+ the namespace passed as `xp` (if given) is compatible with the standard -
126
+ this means that it should come from array-api-compat's `array_namespace`,
127
127
or otherwise be compatible with the standard.
128
+
129
+ Calling functions without providing an `xp` argument means that `array_namespace`
130
+ is called internally to determine the namespace.
128
131
```
129
132
130
133
In the examples shown in the docstrings of functions from this library,
@@ -133,6 +136,9 @@ array namespace `xp`. In reality, code using this library will be written to
133
136
work with any compatible array namespace as ` xp ` , not any particular
134
137
implementation.
135
138
139
+ Some functions may only work with array libraries supported by array-api-compat.
140
+ This will be clearly indicated in the docs.
141
+
136
142
(scope)=
137
143
138
144
## Scope
@@ -143,11 +149,15 @@ Functions that are in-scope for this library will:
143
149
standard.
144
150
- Implement functionality which may be generally useful across various
145
151
libraries.
146
- - Be implemented purely in terms of the array API standard.
147
152
- Be implemented with type annotations and
148
153
[ numpydoc-style docstrings] ( https://numpydoc.readthedocs.io/en/latest/format.html ) .
149
154
- Be tested against ` array-api-strict ` .
150
155
156
+ Functions are implemented purely in terms of the array API standard where
157
+ possible. Where functions must use library-specific helpers for libraries
158
+ supported by array-api-compat, this will be clearly marked in their API
159
+ reference page.
160
+
151
161
In particular, the following kinds of function are also in-scope:
152
162
153
163
- Functions which implement
@@ -158,20 +168,15 @@ In particular, the following kinds of function are also in-scope:
158
168
159
169
The following features are currently out-of-scope for this library:
160
170
161
- - Delegation to known, existing array libraries.
171
+ - Delegation to known, existing array libraries (unless necessary) .
162
172
- It is quite simple to wrap functions in this library to also use existing
163
- implementations where possible. Such delegation will not live in this
164
- library for now, but the array-agnostic functions in this library could form
165
- an array-agnostic backend for such delegating functions in the future, here
166
- or elsewhere.
173
+ implementations. Such delegation will not live in this library for now, but
174
+ the array-agnostic functions in this library could form an array-agnostic
175
+ backend for such delegating functions in the future, here or elsewhere.
167
176
- Functions which accept "array-like" input, or standard-incompatible
168
177
namespaces.
169
178
- It is possible to prepare input arrays and a standard-compatible namespace
170
- via ` array-api-compat ` downstream in consumer libraries. Avoiding use of
171
- ` array-api-compat ` in this library makes it easier to vendor and reduces
172
- potential redundant calls to ` xp.asarray ` and ` array_namespace ` .
173
- - For proposed alternatives to the ` xp=xp ` interface, see
174
- [ this issue] ( https://github.com/data-apis/array-api-extra/issues/6 ) .
179
+ via ` array-api-compat ` downstream in consumer libraries.
175
180
- Functions which are specific to a particular domain.
176
181
- These functions may belong better in an array-consuming library which is
177
182
specific to that domain.
0 commit comments