array-api-strict 2.3__tar.gz → 2.4__tar.gz
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-2.3 → array_api_strict-2.4}/.github/workflows/array-api-tests.yml +7 -7
- {array_api_strict-2.3 → array_api_strict-2.4}/.github/workflows/docs-deploy.yml +1 -1
- {array_api_strict-2.3 → array_api_strict-2.4}/.github/workflows/tests.yml +3 -3
- {array_api_strict-2.3 → array_api_strict-2.4}/CHANGELOG.md +53 -1
- {array_api_strict-2.3/array_api_strict.egg-info → array_api_strict-2.4}/PKG-INFO +5 -4
- array_api_strict-2.4/array-api-tests-xfails.txt +31 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/__init__.py +11 -5
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_array_object.py +226 -200
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_constants.py +1 -1
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_creation_functions.py +97 -119
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_data_type_functions.py +73 -64
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_dtypes.py +35 -24
- array_api_strict-2.4/array_api_strict/_elementwise_functions.py +356 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_fft.py +28 -32
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_flags.py +65 -26
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_helpers.py +23 -14
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_indexing_functions.py +3 -8
- array_api_strict-2.4/array_api_strict/_info.py +134 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_linalg.py +57 -53
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_linear_algebra_functions.py +11 -9
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_manipulation_functions.py +30 -30
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_searching_functions.py +22 -33
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_set_functions.py +4 -6
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_sorting_functions.py +6 -6
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_statistical_functions.py +57 -64
- array_api_strict-2.4/array_api_strict/_typing.py +69 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_utility_functions.py +11 -13
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/_version.py +2 -2
- array_api_strict-2.4/array_api_strict/py.typed +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_array_object.py +163 -56
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_creation_functions.py +14 -12
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_data_type_functions.py +40 -6
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_elementwise_functions.py +94 -45
- array_api_strict-2.4/array_api_strict/tests/test_searching_functions.py +102 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_validation.py +1 -3
- {array_api_strict-2.3 → array_api_strict-2.4/array_api_strict.egg-info}/PKG-INFO +5 -4
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict.egg-info/SOURCES.txt +1 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/changelog.md +53 -1
- {array_api_strict-2.3 → array_api_strict-2.4}/pyproject.toml +18 -4
- array_api_strict-2.3/array-api-tests-xfails.txt +0 -8
- array_api_strict-2.3/array_api_strict/_elementwise_functions.py +0 -700
- array_api_strict-2.3/array_api_strict/_info.py +0 -139
- array_api_strict-2.3/array_api_strict/_typing.py +0 -89
- array_api_strict-2.3/array_api_strict/tests/test_searching_functions.py +0 -24
- {array_api_strict-2.3 → array_api_strict-2.4}/.gitattributes +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/.github/dependabot.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/.github/workflows/dependabot-auto-merge.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/.github/workflows/docs-build.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/.github/workflows/publish-package.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/.github/workflows/ruff.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/.gitignore +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/LICENSE +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/README.md +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/__init__.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/conftest.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_device_support.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_flags.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_indexing_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_linalg.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_manipulation_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_set_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_sorting_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict/tests/test_statistical_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict.egg-info/dependency_links.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict.egg-info/requires.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/array_api_strict.egg-info/top_level.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/Makefile +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/_static/custom.css +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/_static/favicon.png +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/api.rst +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/conf.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/index.md +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/make.bat +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/releasing.md +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/docs/requirements.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/pytest.ini +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/requirements-dev.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/requirements.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/ruff.toml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.4}/setup.cfg +0 -0
|
@@ -3,19 +3,19 @@ name: Array API Tests
|
|
|
3
3
|
on: [push, pull_request]
|
|
4
4
|
|
|
5
5
|
env:
|
|
6
|
-
PYTEST_ARGS: "-v -rxXfE --
|
|
7
|
-
API_VERSIONS: "
|
|
6
|
+
PYTEST_ARGS: "-v -rxXfE --hypothesis-disable-deadline --max-examples 200"
|
|
7
|
+
API_VERSIONS: "2023.12 2024.12"
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
array-api-tests:
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
strategy:
|
|
13
13
|
matrix:
|
|
14
|
-
python-version: ['3.
|
|
15
|
-
numpy-version: ['1.26', 'dev']
|
|
14
|
+
python-version: ['3.12', '3.13']
|
|
15
|
+
numpy-version: ['1.26', '2.2', 'dev']
|
|
16
16
|
exclude:
|
|
17
|
-
- python-version: '3.
|
|
18
|
-
numpy-version: '
|
|
17
|
+
- python-version: '3.13'
|
|
18
|
+
numpy-version: '1.26'
|
|
19
19
|
|
|
20
20
|
steps:
|
|
21
21
|
- name: Checkout array-api-strict
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then
|
|
39
39
|
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;
|
|
40
40
|
else
|
|
41
|
-
python -m pip install 'numpy
|
|
41
|
+
python -m pip install 'numpy=='${{ matrix.numpy-version }};
|
|
42
42
|
fi
|
|
43
43
|
python -m pip install ${GITHUB_WORKSPACE}/array-api-strict
|
|
44
44
|
python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt
|
|
@@ -5,11 +5,11 @@ jobs:
|
|
|
5
5
|
runs-on: ubuntu-latest
|
|
6
6
|
strategy:
|
|
7
7
|
matrix:
|
|
8
|
-
python-version: ['3.
|
|
8
|
+
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
9
9
|
numpy-version: ['1.26', 'dev']
|
|
10
10
|
exclude:
|
|
11
|
-
- python-version: '3.
|
|
12
|
-
numpy-version: '
|
|
11
|
+
- python-version: '3.13'
|
|
12
|
+
numpy-version: '1.26'
|
|
13
13
|
fail-fast: true
|
|
14
14
|
steps:
|
|
15
15
|
- uses: actions/checkout@v4
|
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.
|
|
3
|
+
## 2.4.0 (XXX)
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- The array object no longer defines `__array__`, and conversion to NumPy relies on the
|
|
8
|
+
buffer protocol, `__buffer__` instead. This change should be completely transparent to
|
|
9
|
+
users. Please report any issues this change causes however.
|
|
10
|
+
|
|
11
|
+
- Support for Python versions 3.9-3.11 was dropped. The minimum supported Python
|
|
12
|
+
versions is now 3.12.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- `asarray` no longer accepts nested sequences of arrays. This is consistent with the
|
|
18
|
+
standard, which only allows _a (possibly nested) sequence of Python scalars_. In most
|
|
19
|
+
cases, this requires changing `asarray(list_of_arrays)` to `stack(list_of_arrays)`.
|
|
20
|
+
Note that this effectively disallows code such as
|
|
21
|
+
`asarray([x[i] for i in range(x.shape[0]])` since indexing 1D arrays produces 0D
|
|
22
|
+
arrays, not python scalars.
|
|
23
|
+
|
|
24
|
+
- Fix fancy indexing in a mult-device setting. The indexed arrays and all indexer arrays
|
|
25
|
+
must be the same device. Otherwise, an error is raised.
|
|
26
|
+
|
|
27
|
+
- Make `finfo` and `iinfo` accept arrays or dtypes, as required by the standard.
|
|
28
|
+
|
|
29
|
+
- Make `roll` only accept integers and tuples for the `shift` argument.
|
|
30
|
+
|
|
31
|
+
- Make `reshape` only accept tuples for the `shape` argument.
|
|
32
|
+
|
|
33
|
+
- Make testing of array iteration compatible with Python 3.14.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Contributors
|
|
37
|
+
|
|
38
|
+
The following users contributed to this release:
|
|
39
|
+
|
|
40
|
+
Lumir Balhar,
|
|
41
|
+
Evgeni Burovski,
|
|
42
|
+
Joren Hammudoglu
|
|
43
|
+
Tim Head,
|
|
44
|
+
Guido Imperiale,
|
|
45
|
+
Lucy Liu
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## 2.3.1 (2025-03-20)
|
|
49
|
+
|
|
50
|
+
This is a bugfix release with no new features compared to 2.3. This release fixes an
|
|
51
|
+
issue with `where` for scalar arguments, found in downstream testing of the 2024.12
|
|
52
|
+
support.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## 2.3 (2025-02-27)
|
|
4
56
|
|
|
5
57
|
### Major Changes
|
|
6
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: array_api_strict
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4
|
|
4
4
|
Summary: A strict, minimal implementation of the Python array API standard.
|
|
5
5
|
Author: Consortium for Python Data API Standards
|
|
6
6
|
License: Copyright (c) 2021-2024, NumPy Developers, Consortium for Python Data API Standards
|
|
@@ -35,15 +35,16 @@ License: Copyright (c) 2021-2024, NumPy Developers, Consortium for Python Data A
|
|
|
35
35
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
36
36
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37
37
|
|
|
38
|
+
Project-URL: Homepage, https://data-apis.org/array-api-strict/
|
|
39
|
+
Project-URL: Repository, https://github.com/data-apis/array-api-strict
|
|
38
40
|
Classifier: Programming Language :: Python :: 3
|
|
39
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
40
41
|
Classifier: Programming Language :: Python :: 3.10
|
|
41
42
|
Classifier: Programming Language :: Python :: 3.11
|
|
42
43
|
Classifier: Programming Language :: Python :: 3.12
|
|
43
44
|
Classifier: Programming Language :: Python :: 3.13
|
|
44
45
|
Classifier: License :: OSI Approved :: BSD License
|
|
45
46
|
Classifier: Operating System :: OS Independent
|
|
46
|
-
Requires-Python: >=3.
|
|
47
|
+
Requires-Python: >=3.10
|
|
47
48
|
Description-Content-Type: text/markdown
|
|
48
49
|
License-File: LICENSE
|
|
49
50
|
Requires-Dist: numpy
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Known special case issue in NumPy. Not worth working around here
|
|
2
|
+
# https://github.com/numpy/numpy/issues/21213
|
|
3
|
+
array_api_tests/test_special_cases.py::test_iop[__ipow__(x1_i is -infinity and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +infinity]
|
|
4
|
+
array_api_tests/test_special_cases.py::test_iop[__ipow__(x1_i is -0 and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +0]
|
|
5
|
+
|
|
6
|
+
# Stubs have a comment: (**note**: libraries may return ``NaN`` to match Python behavior.); Apparently, all libraries do just that
|
|
7
|
+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
|
|
8
|
+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
|
|
9
|
+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
|
|
10
|
+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
|
|
11
|
+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
|
|
12
|
+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
|
|
13
|
+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
|
|
14
|
+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
|
|
15
|
+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
|
|
16
|
+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
|
|
17
|
+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
|
|
18
|
+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
|
|
19
|
+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
|
|
20
|
+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
|
|
21
|
+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
|
|
22
|
+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
|
|
23
|
+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
|
|
24
|
+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
|
|
25
|
+
|
|
26
|
+
# The test suite is incorrectly checking sums that have loss of significance
|
|
27
|
+
# (https://github.com/data-apis/array-api-tests/issues/168)
|
|
28
|
+
array_api_tests/test_statistical_functions.py::test_sum
|
|
29
|
+
|
|
30
|
+
array_api_tests/test_special_cases.py::test_nan_propagation[cumulative_prod]
|
|
31
|
+
|
|
@@ -16,6 +16,8 @@ consuming libraries to test their array API usage.
|
|
|
16
16
|
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
+
from types import ModuleType
|
|
20
|
+
|
|
19
21
|
__all__ = []
|
|
20
22
|
|
|
21
23
|
# Warning: __array_api_version__ could change globally with
|
|
@@ -325,12 +327,16 @@ from ._flags import (
|
|
|
325
327
|
ArrayAPIStrictFlags,
|
|
326
328
|
)
|
|
327
329
|
|
|
328
|
-
__all__ += [
|
|
330
|
+
__all__ += [
|
|
331
|
+
'set_array_api_strict_flags',
|
|
332
|
+
'get_array_api_strict_flags',
|
|
333
|
+
'reset_array_api_strict_flags',
|
|
334
|
+
'ArrayAPIStrictFlags',
|
|
335
|
+
'__version__',
|
|
336
|
+
]
|
|
329
337
|
|
|
330
338
|
try:
|
|
331
|
-
from . import
|
|
332
|
-
__version__ = _version.__version__
|
|
333
|
-
del _version
|
|
339
|
+
from ._version import __version__ # type: ignore[import-not-found,unused-ignore]
|
|
334
340
|
except ImportError:
|
|
335
341
|
__version__ = "unknown"
|
|
336
342
|
|
|
@@ -340,7 +346,7 @@ except ImportError:
|
|
|
340
346
|
# use __getattr__. Note that linalg and fft are dynamically added and removed
|
|
341
347
|
# from __all__ in set_array_api_strict_flags.
|
|
342
348
|
|
|
343
|
-
def __getattr__(name):
|
|
349
|
+
def __getattr__(name: str) -> ModuleType:
|
|
344
350
|
if name in ['linalg', 'fft']:
|
|
345
351
|
if name in get_array_api_strict_flags()['enabled_extensions']:
|
|
346
352
|
if name == 'linalg':
|