8000 ENH: Updgrade Array API version to 2024.12 · numpy/numpy@244a08d · GitHub
[go: up one dir, main page]

Skip to content

Commit 244a08d

Browse files
committed
ENH: Updgrade Array API version to 2024.12
1 parent 295e2d5 commit 244a08d

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ jobs:
287287
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
288288
with:
289289
repository: data-apis/array-api-tests
290-
ref: '827edd804bcace9d64176b8115138d29ae3e8dec' # Latest commit as of 2024-07-30
290+
ref: 'c48410f96fc58e02eea844e6b7f6cc01680f77ce' # Latest commit as of 2025-04-01
291291
submodules: 'true'
292292
path: 'array-api-tests'
293293
persist-credentials: false

numpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
# import with `from numpy import *`.
290290
__future_scalars__ = {"str", "bytes", "object"}
291291

292-
__array_api_version__ = "2023.12"
292+
__array_api_version__ = "2024.12"
293293

294294
from ._array_api_info import __array_namespace_info__
295295

numpy/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ _DTypeNum: TypeAlias = L[
978978
]
979979
_DTypeBuiltinKind: TypeAlias = L[0, 1, 2]
980980

981-
_ArrayAPIVersion: TypeAlias = L["2021.12", "2022.12", "2023.12"]
981+
_ArrayAPIVersion: TypeAlias = L["2021.12", "2022.12", "2023.12", "2024.12"]
982982

983983
_CastingKind: TypeAlias = L["no", "equiv", "safe", "same_kind", "unsafe"]
984984

@@ -1193,7 +1193,7 @@ __NUMPY_SETUP__: Final[L[False]] = False
11931193
__numpy_submodules__: Final[set[LiteralString]] = ...
11941194
__former_attrs__: Final[_FormerAttrsDict] = ...
11951195
__future_scalars__: Final[set[L["bytes", "str", "object"]]] = ...
1196-
__array_api_version__: Final[L["2023.12"]] = "2023.12"
1196+
__array_api_version__: Final[L["2024.12"]] = "2024.12"
11971197
test: Final[PytestTester] = ...
11981198

11991199
@type_check_only

numpy/_core/src/multiarray/array_api_standard.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ array_array_namespace(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds
6060
return NULL;
6161
} else if (PyUnicode_CompareWithASCIIString(array_api_version, "2021.12") != 0 &&
6262
PyUnicode_CompareWithASCIIString(array_api_version, "2022.12") != 0 &&
63-
PyUnicode_CompareWithASCIIString(array_api_version, "2023.12") != 0)
63+
PyUnicode_CompareWithASCIIString(array_api_version, "2023.12") != 0 &&
64+
PyUnicode_CompareWithASCIIString(array_api_version, "2024.12") != 0)
6465
{
6566
PyErr_Format(PyExc_ValueError,
6667
"Version \"%U\" of the Array API Standard is not supported.",

numpy/_core/tests/test_regression.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,21 +2573,23 @@ def test__array_namespace__(self):
25732573
assert xp is np
25742574
xp = arr.__array_namespace__(api_version="2023.12")
25752575
assert xp is np
2576+
xp = arr.__array_namespace__(api_version="2024.12")
2577+
assert xp is np
25762578
xp = arr.__array_namespace__(api_version=None)
25772579
assert xp is np
25782580

25792581
with pytest.raises(
25802582
ValueError,
2581-
match="Version \"2024.12\" of the Array API Standard "
2583+
match="Version \"2025.12\" of the Array API Standard "
25822584
"is not supported."
25832585
):
2584-
arr.__array_namespace__(api_version="2024.12")
2586+
arr.__array_namespace__(api_version="2025.12")
25852587

25862588
with pytest.raises(
25872589
ValueError,
25882590
match="Only None and strings are allowed as the Array API version"
25892591
):
2590-
arr.__array_namespace__(api_version=2023)
2592+
arr.__array_namespace__(api_version=2024)
25912593

25922594
def test_isin_refcnt_bug(self):
25932595
# gh-25295

0 commit comments

Comments
 (0)
0