array-api-strict 2.1__py3-none-any.whl → 2.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- array_api_strict/__init__.py +6 -0
- array_api_strict/_array_object.py +27 -33
- array_api_strict/_creation_functions.py +22 -25
- array_api_strict/_elementwise_functions.py +48 -8
- array_api_strict/_linalg.py +2 -0
- array_api_strict/_version.py +3 -3
- array_api_strict/tests/test_array_object.py +29 -28
- array_api_strict/tests/test_creation_functions.py +26 -2
- {array_api_strict-2.1.dist-info → array_api_strict-2.1.2.dist-info}/METADATA +5 -4
- {array_api_strict-2.1.dist-info → array_api_strict-2.1.2.dist-info}/RECORD +13 -13
- {array_api_strict-2.1.dist-info → array_api_strict-2.1.2.dist-info}/WHEEL +1 -1
- {array_api_strict-2.1.dist-info → array_api_strict-2.1.2.dist-info}/LICENSE +0 -0
- {array_api_strict-2.1.dist-info → array_api_strict-2.1.2.dist-info}/top_level.txt +0 -0
array_api_strict/__init__.py
CHANGED
|
@@ -16,6 +16,12 @@ consuming libraries to test their array API usage.
|
|
|
16
16
|
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
+
import numpy as np
|
|
20
|
+
from numpy.lib import NumpyVersion
|
|
21
|
+
|
|
22
|
+
if NumpyVersion(np.__version__) < NumpyVersion('2.1.0'):
|
|
23
|
+
raise ImportError("array-api-strict requires NumPy >= 2.1.0")
|
|
24
|
+
|
|
19
25
|
__all__ = []
|
|
20
26
|
|
|
21
27
|
# Warning: __array_api_version__ could change globally with
|
|
@@ -38,7 +38,7 @@ import types
|
|
|
38
38
|
|
|
39
39
|
if TYPE_CHECKING:
|
|
40
40
|
from typing import Optional, Tuple, Union, Any
|
|
41
|
-
from ._typing import PyCapsule,
|
|
41
|
+
from ._typing import PyCapsule, Dtype
|
|
42
42
|
import numpy.typing as npt
|
|
43
43
|
|
|
44
44
|
import numpy as np
|
|
@@ -66,6 +66,8 @@ ALL_DEVICES = (CPU_DEVICE, Device("device1"), Device("device2"))
|
|
|
66
66
|
|
|
67
67
|
_default = object()
|
|
68
68
|
|
|
69
|
+
_allow_array = False
|
|
70
|
+
|
|
69
71
|
class Array:
|
|
70
72
|
"""
|
|
71
73
|
n-d array object for the array API namespace.
|
|
@@ -145,30 +147,23 @@ class Array:
|
|
|
145
147
|
mid = np.array2string(self._array, separator=', ', prefix=prefix, suffix=suffix)
|
|
146
148
|
return prefix + mid + suffix
|
|
147
149
|
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
+
# Disallow __array__, meaning calling `np.func()` on an array_api_strict
|
|
151
|
+
# array will give an error. If we don't explicitly disallow it, NumPy
|
|
152
|
+
# defaults to creating an object dtype array, which would lead to
|
|
153
|
+
# confusing error messages at best and surprising bugs at worst.
|
|
154
|
+
#
|
|
155
|
+
# The alternative of course is to just support __array__, which is what we
|
|
156
|
+
# used to do. But this isn't actually supported by the standard, so it can
|
|
157
|
+
# lead to code assuming np.asarray(other_array) would always work in the
|
|
158
|
+
# standard.
|
|
150
159
|
def __array__(self, dtype: None | np.dtype[Any] = None, copy: None | bool = None) -> npt.NDArray[Any]:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
"""
|
|
157
|
-
if self._device != CPU_DEVICE:
|
|
158
|
-
raise RuntimeError(f"Can not convert array on the '{self._device}' device to a Numpy array.")
|
|
159
|
-
# copy keyword is new in 2.0.0; for older versions don't use it
|
|
160
|
-
# retry without that keyword.
|
|
161
|
-
if np.__version__[0] < '2':
|
|
162
|
-
return np.asarray(self._array, dtype=dtype)
|
|
163
|
-
elif np.__version__.startswith('2.0.0-dev0'):
|
|
164
|
-
# Handle dev version for which we can't know based on version
|
|
165
|
-
# number whether or not the copy keyword is supported.
|
|
166
|
-
try:
|
|
167
|
-
return np.asarray(self._array, dtype=dtype, copy=copy)
|
|
168
|
-
except TypeError:
|
|
169
|
-
return np.asarray(self._array, dtype=dtype)
|
|
170
|
-
else:
|
|
160
|
+
# We have to allow this to be internally enabled as there's no other
|
|
161
|
+
# easy way to parse a list of Array objects in asarray().
|
|
162
|
+
if _allow_array:
|
|
163
|
+
if self._device != CPU_DEVICE:
|
|
164
|
+
raise RuntimeError(f"Can not convert array on the '{self._device}' device to a Numpy array.")
|
|
171
165
|
return np.asarray(self._array, dtype=dtype, copy=copy)
|
|
166
|
+
raise ValueError("Conversion from an array_api_strict array to a NumPy ndarray is not supported")
|
|
172
167
|
|
|
173
168
|
# These are various helper functions to make the array behavior match the
|
|
174
169
|
# spec in places where it either deviates from or is more strict than
|
|
@@ -274,7 +269,7 @@ class Array:
|
|
|
274
269
|
# behavior for integers within the bounds of the integer dtype.
|
|
275
270
|
# Outside of those bounds we use the default NumPy behavior (either
|
|
276
271
|
# cast or raise OverflowError).
|
|
277
|
-
return Array._new(np.array(scalar, dtype=self.dtype._np_dtype), device=
|
|
272
|
+
return Array._new(np.array(scalar, dtype=self.dtype._np_dtype), device=self.device)
|
|
278
273
|
|
|
279
274
|
@staticmethod
|
|
280
275
|
def _normalize_two_args(x1, x2) -> Tuple[Array, Array]:
|
|
@@ -579,15 +574,14 @@ class Array:
|
|
|
579
574
|
if copy is not _default:
|
|
580
575
|
raise ValueError("The copy argument to __dlpack__ requires at least version 2023.12 of the array API")
|
|
581
576
|
|
|
582
|
-
|
|
583
|
-
if max_version not
|
|
584
|
-
|
|
585
|
-
if dl_device not
|
|
586
|
-
|
|
587
|
-
if copy not
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
return self._array.__dlpack__(stream=stream)
|
|
577
|
+
kwargs = {'stream': stream}
|
|
578
|
+
if max_version is not _default:
|
|
579
|
+
kwargs['max_version'] = max_version
|
|
580
|
+
if dl_device is not _default:
|
|
581
|
+
kwargs['dl_device'] = dl_device
|
|
582
|
+
if copy is not _default:
|
|
583
|
+
kwargs['copy'] = copy
|
|
584
|
+
return self._array.__dlpack__(**kwargs)
|
|
591
585
|
|
|
592
586
|
def __dlpack_device__(self: Array, /) -> Tuple[IntEnum, int]:
|
|
593
587
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
from contextlib import contextmanager
|
|
4
4
|
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
|
|
5
5
|
|
|
6
6
|
if TYPE_CHECKING:
|
|
@@ -16,6 +16,19 @@ from ._flags import get_array_api_strict_flags
|
|
|
16
16
|
|
|
17
17
|
import numpy as np
|
|
18
18
|
|
|
19
|
+
@contextmanager
|
|
20
|
+
def allow_array():
|
|
21
|
+
"""
|
|
22
|
+
Temporarily enable Array.__array__. This is needed for np.array to parse
|
|
23
|
+
list of lists of Array objects.
|
|
24
|
+
"""
|
|
25
|
+
from . import _array_object
|
|
26
|
+
original_value = _array_object._allow_array
|
|
27
|
+
try:
|
|
28
|
+
_array_object._allow_array = True
|
|
29
|
+
yield
|
|
30
|
+
finally:
|
|
31
|
+
_array_object._allow_array = original_value
|
|
19
32
|
|
|
20
33
|
def _check_valid_dtype(dtype):
|
|
21
34
|
# Note: Only spelling dtypes as the dtype objects is supported.
|
|
@@ -67,29 +80,8 @@ def asarray(
|
|
|
67
80
|
if dtype is not None:
|
|
68
81
|
_np_dtype = dtype._np_dtype
|
|
69
82
|
_check_device(device)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if copy is False:
|
|
73
|
-
# Note: copy=False is not yet implemented in np.asarray for
|
|
74
|
-
# NumPy 1
|
|
75
|
-
|
|
76
|
-
# Work around it by creating the new array and seeing if NumPy
|
|
77
|
-
# copies it.
|
|
78
|
-
if isinstance(obj, Array):
|
|
79
|
-
new_array = np.array(obj._array, copy=copy, dtype=_np_dtype)
|
|
80
|
-
if new_array is not obj._array:
|
|
81
|
-
raise ValueError("Unable to avoid copy while creating an array from given array.")
|
|
82
|
-
return Array._new(new_array, device=device)
|
|
83
|
-
elif _supports_buffer_protocol(obj):
|
|
84
|
-
# Buffer protocol will always support no-copy
|
|
85
|
-
return Array._new(np.array(obj, copy=copy, dtype=_np_dtype), device=device)
|
|
86
|
-
else:
|
|
87
|
-
# No-copy is unsupported for Python built-in types.
|
|
88
|
-
raise ValueError("Unable to avoid copy while creating an array from given object.")
|
|
89
|
-
|
|
90
|
-
if copy is None:
|
|
91
|
-
# NumPy 1 treats copy=False the same as the standard copy=None
|
|
92
|
-
copy = False
|
|
83
|
+
if isinstance(obj, Array) and device is None:
|
|
84
|
+
device = obj.device
|
|
93
85
|
|
|
94
86
|
if isinstance(obj, Array):
|
|
95
87
|
return Array._new(np.array(obj._array, copy=copy, dtype=_np_dtype), device=device)
|
|
@@ -97,7 +89,8 @@ def asarray(
|
|
|
97
89
|
# Give a better error message in this case. NumPy would convert this
|
|
98
90
|
# to an object array. TODO: This won't handle large integers in lists.
|
|
99
91
|
raise OverflowError("Integer out of bounds for array dtypes")
|
|
100
|
-
|
|
92
|
+
with allow_array():
|
|
93
|
+
res = np.array(obj, dtype=_np_dtype, copy=copy)
|
|
101
94
|
return Array._new(res, device=device)
|
|
102
95
|
|
|
103
96
|
|
|
@@ -158,6 +151,8 @@ def empty_like(
|
|
|
158
151
|
|
|
159
152
|
_check_valid_dtype(dtype)
|
|
160
153
|
_check_device(device)
|
|
154
|
+
if device is None:
|
|
155
|
+
device = x.device
|
|
161
156
|
|
|
162
157
|
if dtype is not None:
|
|
163
158
|
dtype = dtype._np_dtype
|
|
@@ -260,6 +255,8 @@ def full_like(
|
|
|
260
255
|
|
|
261
256
|
_check_valid_dtype(dtype)
|
|
262
257
|
_check_device(device)
|
|
258
|
+
if device is None:
|
|
259
|
+
device = x.device
|
|
263
260
|
|
|
264
261
|
if dtype is not None:
|
|
265
262
|
dtype = dtype._np_dtype
|
|
@@ -14,6 +14,7 @@ from ._dtypes import (
|
|
|
14
14
|
from ._array_object import Array
|
|
15
15
|
from ._flags import requires_api_version
|
|
16
16
|
from ._creation_functions import asarray
|
|
17
|
+
from ._data_type_functions import broadcast_to, iinfo
|
|
17
18
|
|
|
18
19
|
from typing import Optional, Union
|
|
19
20
|
|
|
@@ -325,14 +326,51 @@ def clip(
|
|
|
325
326
|
if min is not None and max is not None and np.any(min > max):
|
|
326
327
|
raise ValueError("min must be less than or equal to max")
|
|
327
328
|
|
|
328
|
-
|
|
329
|
-
#
|
|
330
|
-
#
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
329
|
+
# np.clip does type promotion but the array API clip requires that the
|
|
330
|
+
# output have the same dtype as x. We do this instead of just downcasting
|
|
331
|
+
# the result of xp.clip() to handle some corner cases better (e.g.,
|
|
332
|
+
# avoiding uint64 -> float64 promotion).
|
|
333
|
+
|
|
334
|
+
# Note: cases where min or max overflow (integer) or round (float) in the
|
|
335
|
+
# wrong direction when downcasting to x.dtype are unspecified. This code
|
|
336
|
+
# just does whatever NumPy does when it downcasts in the assignment, but
|
|
337
|
+
# other behavior could be preferred, especially for integers. For example,
|
|
338
|
+
# this code produces:
|
|
339
|
+
|
|
340
|
+
# >>> clip(asarray(0, dtype=int8), asarray(128, dtype=int16), None)
|
|
341
|
+
# -128
|
|
342
|
+
|
|
343
|
+
# but an answer of 0 might be preferred. See
|
|
344
|
+
# https://github.com/numpy/numpy/issues/24976 for more discussion on this issue.
|
|
345
|
+
|
|
346
|
+
# At least handle the case of Python integers correctly (see
|
|
347
|
+
# https://github.com/numpy/numpy/pull/26892).
|
|
348
|
+
if type(min) is int and min <= iinfo(x.dtype).min:
|
|
349
|
+
min = None
|
|
350
|
+
if type(max) is int and max >= iinfo(x.dtype).max:
|
|
351
|
+
max = None
|
|
352
|
+
|
|
353
|
+
def _isscalar(a):
|
|
354
|
+
return isinstance(a, (int, float, type(None)))
|
|
355
|
+
min_shape = () if _isscalar(min) else min.shape
|
|
356
|
+
max_shape = () if _isscalar(max) else max.shape
|
|
357
|
+
|
|
358
|
+
result_shape = np.broadcast_shapes(x.shape, min_shape, max_shape)
|
|
359
|
+
|
|
360
|
+
out = asarray(broadcast_to(x, result_shape), copy=True)._array
|
|
361
|
+
device = x.device
|
|
362
|
+
x = x._array
|
|
363
|
+
|
|
364
|
+
if min is not None:
|
|
365
|
+
a = np.broadcast_to(np.asarray(min), result_shape)
|
|
366
|
+
ia = (out < a) | np.isnan(a)
|
|
367
|
+
|
|
368
|
+
out[ia] = a[ia]
|
|
369
|
+
if max is not None:
|
|
370
|
+
b = np.broadcast_to(np.asarray(max), result_shape)
|
|
371
|
+
ib = (out > b) | np.isnan(b)
|
|
372
|
+
out[ib] = b[ib]
|
|
373
|
+
return Array._new(out, device=device)
|
|
336
374
|
|
|
337
375
|
def conj(x: Array, /) -> Array:
|
|
338
376
|
"""
|
|
@@ -855,6 +893,8 @@ def sign(x: Array, /) -> Array:
|
|
|
855
893
|
"""
|
|
856
894
|
if x.dtype not in _numeric_dtypes:
|
|
857
895
|
raise TypeError("Only numeric dtypes are allowed in sign")
|
|
896
|
+
if x.dtype in _complex_floating_dtypes:
|
|
897
|
+
return x/abs(x)
|
|
858
898
|
return Array._new(np.sign(x._array), device=x.device)
|
|
859
899
|
|
|
860
900
|
|
array_api_strict/_linalg.py
CHANGED
|
@@ -267,6 +267,8 @@ def pinv(x: Array, /, *, rtol: Optional[Union[float, Array]] = None) -> Array:
|
|
|
267
267
|
# default tolerance by max(M, N).
|
|
268
268
|
if rtol is None:
|
|
269
269
|
rtol = max(x.shape[-2:]) * finfo(x.dtype).eps
|
|
270
|
+
if isinstance(rtol, Array):
|
|
271
|
+
rtol = rtol._array
|
|
270
272
|
return Array._new(np.linalg.pinv(x._array, rcond=rtol), device=x.device)
|
|
271
273
|
|
|
272
274
|
@requires_extension('linalg')
|
array_api_strict/_version.py
CHANGED
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "2024-
|
|
11
|
+
"date": "2024-11-07T18:09:02-0700",
|
|
12
12
|
"dirty": false,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "2.1"
|
|
14
|
+
"full-revisionid": "c9fe697bec8de8e402d8beb71bbeb96ca70c772e",
|
|
15
|
+
"version": "2.1.2"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -6,7 +6,7 @@ import numpy as np
|
|
|
6
6
|
import pytest
|
|
7
7
|
|
|
8
8
|
from .. import ones, asarray, result_type, all, equal
|
|
9
|
-
from .._array_object import Array, CPU_DEVICE
|
|
9
|
+
from .._array_object import Array, CPU_DEVICE, Device
|
|
10
10
|
from .._dtypes import (
|
|
11
11
|
_all_dtypes,
|
|
12
12
|
_boolean_dtypes,
|
|
@@ -88,6 +88,14 @@ def test_validate_index():
|
|
|
88
88
|
assert_raises(IndexError, lambda: a[0])
|
|
89
89
|
assert_raises(IndexError, lambda: a[:])
|
|
90
90
|
|
|
91
|
+
def test_promoted_scalar_inherits_device():
|
|
92
|
+
device1 = Device("device1")
|
|
93
|
+
x = asarray([1., 2, 3], device=device1)
|
|
94
|
+
|
|
95
|
+
y = x ** 2
|
|
96
|
+
|
|
97
|
+
assert y.device == device1
|
|
98
|
+
|
|
91
99
|
def test_operators():
|
|
92
100
|
# For every operator, we test that it works for the required type
|
|
93
101
|
# combinations and raises TypeError otherwise
|
|
@@ -342,23 +350,19 @@ def test_array_properties():
|
|
|
342
350
|
assert isinstance(b.mT, Array)
|
|
343
351
|
assert b.mT.shape == (3, 2)
|
|
344
352
|
|
|
345
|
-
def test___array__():
|
|
346
|
-
a = ones((2, 3), dtype=int16)
|
|
347
|
-
assert np.asarray(a) is a._array
|
|
348
|
-
b = np.asarray(a, dtype=np.float64)
|
|
349
|
-
assert np.all(np.equal(b, np.ones((2, 3), dtype=np.float64)))
|
|
350
|
-
assert b.dtype == np.float64
|
|
351
353
|
|
|
352
354
|
def test_array_conversion():
|
|
353
355
|
# Check that arrays on the CPU device can be converted to NumPy
|
|
354
|
-
# but arrays on other devices can't
|
|
356
|
+
# but arrays on other devices can't. Note this is testing the logic in
|
|
357
|
+
# __array__, which is only used in asarray when converting lists of
|
|
358
|
+
# arrays.
|
|
355
359
|
a = ones((2, 3))
|
|
356
|
-
|
|
360
|
+
asarray([a])
|
|
357
361
|
|
|
358
362
|
for device in ("device1", "device2"):
|
|
359
363
|
a = ones((2, 3), device=array_api_strict.Device(device))
|
|
360
364
|
with pytest.raises(RuntimeError, match="Can not convert array"):
|
|
361
|
-
|
|
365
|
+
asarray([a])
|
|
362
366
|
|
|
363
367
|
def test_allow_newaxis():
|
|
364
368
|
a = ones(5)
|
|
@@ -452,22 +456,19 @@ def dlpack_2023_12(api_version):
|
|
|
452
456
|
set_array_api_strict_flags(api_version=api_version)
|
|
453
457
|
|
|
454
458
|
a = asarray([1, 2, 3], dtype=int8)
|
|
455
|
-
# Never an error
|
|
456
|
-
a.__dlpack__()
|
|
457
|
-
|
|
458
459
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
460
|
+
# Do not error
|
|
461
|
+
a.__dlpack__()
|
|
462
|
+
a.__dlpack__(dl_device=CPU_DEVICE)
|
|
463
|
+
a.__dlpack__(dl_device=None)
|
|
464
|
+
a.__dlpack__(max_version=(1, 0))
|
|
465
|
+
a.__dlpack__(max_version=None)
|
|
466
|
+
a.__dlpack__(copy=False)
|
|
467
|
+
a.__dlpack__(copy=True)
|
|
468
|
+
a.__dlpack__(copy=None)
|
|
469
|
+
|
|
470
|
+
x = np.from_dlpack(a)
|
|
471
|
+
assert isinstance(x, np.ndarray)
|
|
472
|
+
assert x.dtype == np.int8
|
|
473
|
+
assert x.shape == (3,)
|
|
474
|
+
assert np.all(x == np.asarray([1, 2, 3]))
|
|
@@ -22,8 +22,8 @@ from .._creation_functions import (
|
|
|
22
22
|
zeros,
|
|
23
23
|
zeros_like,
|
|
24
24
|
)
|
|
25
|
-
from .._dtypes import float32, float64
|
|
26
|
-
from .._array_object import Array, CPU_DEVICE
|
|
25
|
+
from .._dtypes import int16, float32, float64
|
|
26
|
+
from .._array_object import Array, CPU_DEVICE, Device
|
|
27
27
|
from .._flags import set_array_api_strict_flags
|
|
28
28
|
|
|
29
29
|
def test_asarray_errors():
|
|
@@ -97,6 +97,30 @@ def test_asarray_copy():
|
|
|
97
97
|
a[0] = 0
|
|
98
98
|
assert all(b[0] == 0)
|
|
99
99
|
|
|
100
|
+
def test_asarray_list_of_lists():
|
|
101
|
+
a = asarray(1, dtype=int16)
|
|
102
|
+
b = asarray([1], dtype=int16)
|
|
103
|
+
res = asarray([a, a])
|
|
104
|
+
assert res.shape == (2,)
|
|
105
|
+
assert res.dtype == int16
|
|
106
|
+
assert all(res == asarray([1, 1]))
|
|
107
|
+
|
|
108
|
+
res = asarray([b, b])
|
|
109
|
+
assert res.shape == (2, 1)
|
|
110
|
+
assert res.dtype == int16
|
|
111
|
+
assert all(res == asarray([[1], [1]]))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def test_asarray_device_inference():
|
|
115
|
+
assert asarray([1, 2, 3]).device == CPU_DEVICE
|
|
116
|
+
|
|
117
|
+
x = asarray([1, 2, 3])
|
|
118
|
+
assert asarray(x).device == CPU_DEVICE
|
|
119
|
+
|
|
120
|
+
device1 = Device("device1")
|
|
121
|
+
x = asarray([1, 2, 3], device=device1)
|
|
122
|
+
assert asarray(x).device == device1
|
|
123
|
+
|
|
100
124
|
def test_arange_errors():
|
|
101
125
|
arange(1, device=CPU_DEVICE) # Doesn't error
|
|
102
126
|
assert_raises(ValueError, lambda: arange(1, device="cpu"))
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: array_api_strict
|
|
3
|
-
Version: 2.1
|
|
3
|
+
Version: 2.1.2
|
|
4
4
|
Summary: A strict, minimal implementation of the Python array API standard.
|
|
5
5
|
Home-page: https://data-apis.org/array-api-strict/
|
|
6
6
|
Author: Consortium for Python Data API Standards
|
|
7
7
|
License: MIT
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
10
9
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
13
14
|
Classifier: License :: OSI Approved :: BSD License
|
|
14
15
|
Classifier: Operating System :: OS Independent
|
|
15
|
-
Requires-Python: >=3.
|
|
16
|
+
Requires-Python: >=3.10
|
|
16
17
|
Description-Content-Type: text/markdown
|
|
17
18
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: numpy
|
|
19
|
+
Requires-Dist: numpy >=2.1
|
|
19
20
|
|
|
20
21
|
# array-api-strict
|
|
21
22
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
array_api_strict/__init__.py,sha256=
|
|
2
|
-
array_api_strict/_array_object.py,sha256=
|
|
1
|
+
array_api_strict/__init__.py,sha256=BKVX_n63ZyGiX5sod0pPMqESM1ae0nZIJtYBGMKQSps,6967
|
|
2
|
+
array_api_strict/_array_object.py,sha256=l79bhjmLZZpjUWGa_eo_vevCcfeuV7_y4eop4exy3Uo,51011
|
|
3
3
|
array_api_strict/_constants.py,sha256=AYayN2jf1Dp5rXZ7WPBdUhtPBo_JMCi-pD9oW5zmFkI,87
|
|
4
|
-
array_api_strict/_creation_functions.py,sha256=
|
|
4
|
+
array_api_strict/_creation_functions.py,sha256=6OCWwE_bXN77vkufSNIXlWd3gLFUQT53NSd3tDffLcs,11867
|
|
5
5
|
array_api_strict/_data_type_functions.py,sha256=sKxKRQiwoXPwQJPbiN5BhF9rbc3ZtXfjRuglB7VsIgo,7016
|
|
6
6
|
array_api_strict/_dtypes.py,sha256=QDGo9rqiS_o3quv7QRFM0j6DkvOjRauQ1Ymikwlu8Ns,6213
|
|
7
|
-
array_api_strict/_elementwise_functions.py,sha256=
|
|
7
|
+
array_api_strict/_elementwise_functions.py,sha256=g9YecX4gM4V6UCjl7b7I752EFXhRusjm-EKGZ12jDeI,38651
|
|
8
8
|
array_api_strict/_fft.py,sha256=xH1o4j_amq3e1yGVChV6vms7oAfCzpzB18I-IzjNSXw,9702
|
|
9
9
|
array_api_strict/_flags.py,sha256=hXe5cTFNlFEgbB4nsEazbAPFwnsFnn52wGRYRDjfCFg,13121
|
|
10
10
|
array_api_strict/_indexing_functions.py,sha256=VORFyAFCZjLpL6gZ_PNVNKbQjpjhIXQDNDDHf7Mjy_U,970
|
|
11
11
|
array_api_strict/_info.py,sha256=WWvUjNITc5-jLyS4KrnwTidD3baD9DjHseV254hCUY0,3567
|
|
12
|
-
array_api_strict/_linalg.py,sha256=
|
|
12
|
+
array_api_strict/_linalg.py,sha256=sfmd5fuq2nHy_9kD2QQ23_JbbVZo7LHFgb10qjrr7nw,19846
|
|
13
13
|
array_api_strict/_linear_algebra_functions.py,sha256=12XPBU27X3WZdaq9Ob2eUmL_PxMzDNF76pY4iESlPyo,3872
|
|
14
14
|
array_api_strict/_manipulation_functions.py,sha256=Pa1gVRlaSC39-Zd6n4Q8c9P0anZYdyCh95Wyx3az3lc,6681
|
|
15
15
|
array_api_strict/_searching_functions.py,sha256=32IiLLpa91N-jtzaxj4Nw9nQgF2ROkcNZ-XH6WQQUHY,3233
|
|
@@ -18,11 +18,11 @@ array_api_strict/_sorting_functions.py,sha256=GG7g2NYCFn2G2fFS6ZdfYOWpuuSIrdZdJW
|
|
|
18
18
|
array_api_strict/_statistical_functions.py,sha256=dMJ-x8TQW5MD2rFYCmRH6QthA2KDKXjhkj4hcbd3LSU,5148
|
|
19
19
|
array_api_strict/_typing.py,sha256=TpmU57g3EAPY9PT6hJEhzBduVrwXJUWvmoBlhy5bQuQ,1803
|
|
20
20
|
array_api_strict/_utility_functions.py,sha256=khxtvqPWSDpNp65VgoJUtO4zEfTiGfZZGu_MHwyfmmI,913
|
|
21
|
-
array_api_strict/_version.py,sha256=
|
|
21
|
+
array_api_strict/_version.py,sha256=pdm1CW0Mq5qsnK4lz9UzkaRIItnAetbWP3x598JT1sY,497
|
|
22
22
|
array_api_strict/tests/__init__.py,sha256=t_2GZ3lKcsu4ec4GMKPUDYaeMUJyDquBlQAcPgj7kFE,282
|
|
23
23
|
array_api_strict/tests/conftest.py,sha256=-wIDryl2MdRLdSonU1G1xWssNq2TFKiWuHquNasXYA8,468
|
|
24
|
-
array_api_strict/tests/test_array_object.py,sha256=
|
|
25
|
-
array_api_strict/tests/test_creation_functions.py,sha256=
|
|
24
|
+
array_api_strict/tests/test_array_object.py,sha256=l-PYVbgjRd5O0c7A2ysMmS7jNjsv6pz6-Qd1kP_-DUg,19964
|
|
25
|
+
array_api_strict/tests/test_creation_functions.py,sha256=ve0MeqZPrG2dmCG3hTVhap1YgIW-lAaSZIJ_ZoOV9cQ,8323
|
|
26
26
|
array_api_strict/tests/test_data_type_functions.py,sha256=pLAtm96gpAduNVqq-914JvjAollzhBp4YojVfNScBzs,2138
|
|
27
27
|
array_api_strict/tests/test_device_support.py,sha256=zpfhHxeRREoXfp0qZTlilm2ZceBc71uCKea1GMVe-ZU,855
|
|
28
28
|
array_api_strict/tests/test_elementwise_functions.py,sha256=bKw3b4G-v3yEmmUW2HNXRRQ2tbEPopkrUKbvF8jvUpI,6943
|
|
@@ -34,8 +34,8 @@ array_api_strict/tests/test_set_functions.py,sha256=ikzab1j3SXxGf0OqwHrOAM13HwQe
|
|
|
34
34
|
array_api_strict/tests/test_sorting_functions.py,sha256=1xvQBKts5KTKYc-puMITX9iR_KTbzzVB8fY-SObad_Y,899
|
|
35
35
|
array_api_strict/tests/test_statistical_functions.py,sha256=JwS4DhASt5T0YUNtbFK2nSXgDrVVZx1tVpe7LU2aPK4,1365
|
|
36
36
|
array_api_strict/tests/test_validation.py,sha256=JdsK4z1M0U5YoJrfWSzOpEhmlehvZHF5SG0I0k6oDy8,672
|
|
37
|
-
array_api_strict-2.1.dist-info/LICENSE,sha256=djDm4UfHAJmycwFUNyUmrTdRkrFF9Ac8uqIlbxH7j5Y,1585
|
|
38
|
-
array_api_strict-2.1.dist-info/METADATA,sha256=
|
|
39
|
-
array_api_strict-2.1.dist-info/WHEEL,sha256=
|
|
40
|
-
array_api_strict-2.1.dist-info/top_level.txt,sha256=M4cE8VLgRHp_d9TPkbk7_I4JriELFdEJz-NKJJqAkAE,17
|
|
41
|
-
array_api_strict-2.1.dist-info/RECORD,,
|
|
37
|
+
array_api_strict-2.1.2.dist-info/LICENSE,sha256=djDm4UfHAJmycwFUNyUmrTdRkrFF9Ac8uqIlbxH7j5Y,1585
|
|
38
|
+
array_api_strict-2.1.2.dist-info/METADATA,sha256=I0frr8wfn_ufn0Oz65tfCCcO9ySe3SKiiGLn9xPmY7g,1647
|
|
39
|
+
array_api_strict-2.1.2.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
40
|
+
array_api_strict-2.1.2.dist-info/top_level.txt,sha256=M4cE8VLgRHp_d9TPkbk7_I4JriELFdEJz-NKJJqAkAE,17
|
|
41
|
+
array_api_strict-2.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|