From 1a9952745607c6ba626b7834cacab8683cefe314 Mon Sep 17 00:00:00 2001 From: 34j <34j.github@proton.me> Date: Thu, 11 Dec 2025 18:18:52 +0900 Subject: [PATCH 1/4] feat: add "latest" attribute --- README.md | 6 +++--- docs/conf.py | 1 + src/array_api/__init__.py | 3 +++ src/array_api_compat/__init__.pyi | 2 +- tests/test_main.py | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d90efa3..b7b6f3d 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ xp = array_api_compat.array_namespace(x) There are multiple ways to type functions: - ```python - from array_api._2024_12 import Array + from array_api.latest import Array def simple(x: Array) -> Array: return x + 1 @@ -92,7 +92,7 @@ You can test if an object matches the Protocol as they are [`runtime-checkable`] ```python import array_api_strict -from array_api._2024_12 import ArrayNamespace, ArrayNamespaceFull +from array_api.latest import ArrayNamespace, ArrayNamespaceFull assert isinstance(array_api_strict, ArrayNamespace) @@ -106,7 +106,7 @@ assert not isinstance(array_api_strict, ArrayNamespaceFull) - To clarify the input and output shapes, `ShapedArray` and `ShapedAnyArray` can be used: ```python - from array_api._2024_12 import ShapedAnyArray as Array + from array_api.latest import ShapedAnyArray as Array def sum_last_axis[*TShape](x: Array[*TShape, Any]) -> Array[*TShape]: return xp.sum(x, axis=-1) diff --git a/docs/conf.py b/docs/conf.py index 73e6a26..62c3d40 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -78,6 +78,7 @@ def run_apidoc(_: Any) -> None: "--force", "--module-first", "--private", + "--separate", "-o", docs_path.as_posix(), module_path.as_posix(), diff --git a/src/array_api/__init__.py b/src/array_api/__init__.py index 9b102be..502737c 100644 --- a/src/array_api/__init__.py +++ b/src/array_api/__init__.py @@ -1 +1,4 @@ __version__ = "1.1.5" +from . import _2024_12 as latest + +__all__ = ["latest"] diff --git a/src/array_api_compat/__init__.pyi b/src/array_api_compat/__init__.pyi index eef5b96..18eac3d 100644 --- a/src/array_api_compat/__init__.pyi +++ b/src/array_api_compat/__init__.pyi @@ -1,6 +1,6 @@ from typing import Any, Literal -from array_api._2024_12 import Array, ArrayNamespaceFull +from array_api.latest import Array, ArrayNamespaceFull # return full namespace for convenience # because optional attributes are not supported diff --git a/tests/test_main.py b/tests/test_main.py index 92750f2..375537b 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -3,7 +3,7 @@ import array_api_strict -from array_api._2024_12 import ArrayNamespace +from array_api.latest import ArrayNamespace def test_strict_supset_namespace(): From bd1f149b40f15946c5cc72406d89a65c6056b4c0 Mon Sep 17 00:00:00 2001 From: 34j <34j.github@proton.me> Date: Thu, 11 Dec 2025 18:21:39 +0900 Subject: [PATCH 2/4] feat: add "latest" attribute --- src/array_api/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/array_api/__init__.py b/src/array_api/__init__.py index 502737c..c59c640 100644 --- a/src/array_api/__init__.py +++ b/src/array_api/__init__.py @@ -1,4 +1,6 @@ __version__ = "1.1.5" -from . import _2024_12 as latest +from . import _2024_12 + +latest = _2024_12 __all__ = ["latest"] From 10efea2985f55c34e1905ec84d5b73bb44861919 Mon Sep 17 00:00:00 2001 From: 34j <34j.github@proton.me> Date: Thu, 11 Dec 2025 18:23:17 +0900 Subject: [PATCH 3/4] feat: add "latest" attribute --- src/array_api/__init__.py | 5 ----- src/array_api/latest.py | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) create mode 100644 src/array_api/latest.py diff --git a/src/array_api/__init__.py b/src/array_api/__init__.py index c59c640..9b102be 100644 --- a/src/array_api/__init__.py +++ b/src/array_api/__init__.py @@ -1,6 +1 @@ __version__ = "1.1.5" -from . import _2024_12 - -latest = _2024_12 - -__all__ = ["latest"] diff --git a/src/array_api/latest.py b/src/array_api/latest.py new file mode 100644 index 0000000..d2672b1 --- /dev/null +++ b/src/array_api/latest.py @@ -0,0 +1 @@ +from ._2024_12 import * # noqa From 241d8ad1f6a13e82096fd8bafe9d2d3ae3090dcd Mon Sep 17 00:00:00 2001 From: 34j <34j.github@proton.me> Date: Thu, 11 Dec 2025 18:29:28 +0900 Subject: [PATCH 4/4] docs: add autosummary --- docs/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 62c3d40..a40087d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,8 +27,10 @@ "myst_parser", "sphinx.ext.napoleon", "sphinx.ext.autodoc", + "sphinx.ext.autosummary", "sphinx.ext.viewcode", ] +autosummary_generate = True napoleon_google_docstring = False # The suffix of source filenames.