array-api-strict 2.3__tar.gz → 2.3.1__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.3.1}/.github/workflows/array-api-tests.yml +1 -1
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.github/workflows/docs-deploy.yml +1 -1
- {array_api_strict-2.3 → array_api_strict-2.3.1}/CHANGELOG.md +8 -1
- {array_api_strict-2.3/array_api_strict.egg-info → array_api_strict-2.3.1}/PKG-INFO +2 -2
- array_api_strict-2.3.1/array-api-tests-xfails.txt +28 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_helpers.py +1 -1
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_searching_functions.py +2 -12
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_version.py +2 -2
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_searching_functions.py +21 -1
- {array_api_strict-2.3 → array_api_strict-2.3.1/array_api_strict.egg-info}/PKG-INFO +2 -2
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/changelog.md +8 -1
- {array_api_strict-2.3 → array_api_strict-2.3.1}/pyproject.toml +1 -1
- array_api_strict-2.3/array-api-tests-xfails.txt +0 -8
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.gitattributes +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.github/dependabot.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.github/workflows/dependabot-auto-merge.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.github/workflows/docs-build.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.github/workflows/publish-package.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.github/workflows/ruff.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.github/workflows/tests.yml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/.gitignore +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/LICENSE +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/README.md +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/__init__.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_array_object.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_constants.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_creation_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_data_type_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_dtypes.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_elementwise_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_fft.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_flags.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_indexing_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_info.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_linalg.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_linear_algebra_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_manipulation_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_set_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_sorting_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_statistical_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_typing.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_utility_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/__init__.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/conftest.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_array_object.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_creation_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_data_type_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_device_support.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_elementwise_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_flags.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_indexing_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_linalg.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_manipulation_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_set_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_sorting_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_statistical_functions.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_validation.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict.egg-info/SOURCES.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict.egg-info/dependency_links.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict.egg-info/requires.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict.egg-info/top_level.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/Makefile +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/_static/custom.css +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/_static/favicon.png +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/api.rst +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/conf.py +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/index.md +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/make.bat +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/releasing.md +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/docs/requirements.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/pytest.ini +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/requirements-dev.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/requirements.txt +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/ruff.toml +0 -0
- {array_api_strict-2.3 → array_api_strict-2.3.1}/setup.cfg +0 -0
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.3 (2025-
|
|
3
|
+
## 2.3.1 (2025-03-20)
|
|
4
|
+
|
|
5
|
+
This is a bugfix release with no new features compared to 2.3. This release fixes an
|
|
6
|
+
issue with `where` for scalar arguments, found in downstream testing of the 2024.12
|
|
7
|
+
support.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 2.3 (2025-02-27)
|
|
4
11
|
|
|
5
12
|
### Major Changes
|
|
6
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: array_api_strict
|
|
3
|
-
Version: 2.3
|
|
3
|
+
Version: 2.3.1
|
|
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
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
@@ -31,7 +31,7 @@ def _maybe_normalize_py_scalars(x1, x2, dtype_category, func_name):
|
|
|
31
31
|
x2 = x1._promote_scalar(x2)
|
|
32
32
|
else:
|
|
33
33
|
if x1.dtype not in _allowed_dtypes or x2.dtype not in _allowed_dtypes:
|
|
34
|
-
raise TypeError(f"Only {dtype_category} dtypes are allowed {func_name}. "
|
|
34
|
+
raise TypeError(f"Only {dtype_category} dtypes are allowed in {func_name}(...). "
|
|
35
35
|
f"Got {x1.dtype} and {x2.dtype}.")
|
|
36
36
|
return x1, x2
|
|
37
37
|
|
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from ._array_object import Array
|
|
4
4
|
from ._dtypes import _result_type, _real_numeric_dtypes, bool as _bool
|
|
5
5
|
from ._flags import requires_data_dependent_shapes, requires_api_version, get_array_api_strict_flags
|
|
6
|
+
from ._helpers import _maybe_normalize_py_scalars
|
|
6
7
|
|
|
7
8
|
from typing import TYPE_CHECKING
|
|
8
9
|
if TYPE_CHECKING:
|
|
@@ -101,18 +102,7 @@ def where(
|
|
|
101
102
|
See its docstring for more information.
|
|
102
103
|
"""
|
|
103
104
|
if get_array_api_strict_flags()['api_version'] > '2023.12':
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if isinstance(x1, (bool, float, complex, int)):
|
|
107
|
-
x1 = Array._new(np.asarray(x1), device=condition.device)
|
|
108
|
-
num_scalars += 1
|
|
109
|
-
|
|
110
|
-
if isinstance(x2, (bool, float, complex, int)):
|
|
111
|
-
x2 = Array._new(np.asarray(x2), device=condition.device)
|
|
112
|
-
num_scalars += 1
|
|
113
|
-
|
|
114
|
-
if num_scalars == 2:
|
|
115
|
-
raise ValueError("One of x1, x2 arguments must be an array.")
|
|
105
|
+
x1, x2 = _maybe_normalize_py_scalars(x1, x2, "all", "where")
|
|
116
106
|
|
|
117
107
|
# Call result type here just to raise on disallowed type combinations
|
|
118
108
|
_result_type(x1.dtype, x2.dtype)
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_searching_functions.py
RENAMED
|
@@ -20,5 +20,25 @@ def test_where_with_scalars():
|
|
|
20
20
|
assert xp.all(x_where == expected)
|
|
21
21
|
|
|
22
22
|
# The spec does not allow both x1 and x2 to be scalars
|
|
23
|
-
with pytest.raises(
|
|
23
|
+
with pytest.raises(TypeError, match="Two scalars"):
|
|
24
24
|
xp.where(x == 1, 42, 44)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_where_mixed_dtypes():
|
|
28
|
+
# https://github.com/data-apis/array-api-strict/issues/131
|
|
29
|
+
x = xp.asarray([1., 2.])
|
|
30
|
+
res = xp.where(x > 1.5, x, 0)
|
|
31
|
+
assert res.dtype == x.dtype
|
|
32
|
+
assert all(res == xp.asarray([0., 2.]))
|
|
33
|
+
|
|
34
|
+
# retry with boolean x1, x2
|
|
35
|
+
c = x > 1.5
|
|
36
|
+
res = xp.where(c, False, c)
|
|
37
|
+
assert all(res == xp.asarray([False, False]))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_where_f32():
|
|
41
|
+
# https://github.com/data-apis/array-api-strict/issues/131#issuecomment-2723016294
|
|
42
|
+
res = xp.where(xp.asarray([True, False]), 1., xp.asarray([2, 2], dtype=xp.float32))
|
|
43
|
+
assert res.dtype == xp.float32
|
|
44
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: array_api_strict
|
|
3
|
-
Version: 2.3
|
|
3
|
+
Version: 2.3.1
|
|
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
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 2.3 (2025-
|
|
3
|
+
## 2.3.1 (2025-03-20)
|
|
4
|
+
|
|
5
|
+
This is a bugfix release with no new features compared to 2.3. This release fixes an
|
|
6
|
+
issue with `where` for scalar arguments, found in downstream testing of the 2024.12
|
|
7
|
+
support.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 2.3 (2025-02-27)
|
|
4
11
|
|
|
5
12
|
### Major Changes
|
|
6
13
|
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
# The test suite is incorrectly checking sums that have loss of significance
|
|
7
|
-
# (https://github.com/data-apis/array-api-tests/issues/168)
|
|
8
|
-
array_api_tests/test_statistical_functions.py::test_sum
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/_linear_algebra_functions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_creation_functions.py
RENAMED
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_data_type_functions.py
RENAMED
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_device_support.py
RENAMED
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_elementwise_functions.py
RENAMED
|
File without changes
|
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_indexing_functions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_set_functions.py
RENAMED
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_sorting_functions.py
RENAMED
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict/tests/test_statistical_functions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{array_api_strict-2.3 → array_api_strict-2.3.1}/array_api_strict.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|