Skip to content

Commit 2a0f531

Browse files
authored
feat: add latest attribute (#161)
1 parent 07c726f commit 2a0f531

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ xp = array_api_compat.array_namespace(x)
6868
There are multiple ways to type functions:
6969

7070
- ```python
71-
from array_api._2024_12 import Array
71+
from array_api.latest import Array
7272

7373
def simple(x: Array) -> Array:
7474
return x + 1
@@ -92,7 +92,7 @@ You can test if an object matches the Protocol as they are [`runtime-checkable`]
9292
```python
9393
import array_api_strict
9494

95-
from array_api._2024_12 import ArrayNamespace, ArrayNamespaceFull
95+
from array_api.latest import ArrayNamespace, ArrayNamespaceFull
9696

9797

9898
assert isinstance(array_api_strict, ArrayNamespace)
@@ -106,7 +106,7 @@ assert not isinstance(array_api_strict, ArrayNamespaceFull)
106106
- To clarify the input and output shapes, `ShapedArray` and `ShapedAnyArray` can be used:
107107

108108
```python
109-
from array_api._2024_12 import ShapedAnyArray as Array
109+
from array_api.latest import ShapedAnyArray as Array
110110

111111
def sum_last_axis[*TShape](x: Array[*TShape, Any]) -> Array[*TShape]:
112112
return xp.sum(x, axis=-1)

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
"myst_parser",
2828
"sphinx.ext.napoleon",
2929
"sphinx.ext.autodoc",
30+
"sphinx.ext.autosummary",
3031
"sphinx.ext.viewcode",
3132
]
33+
autosummary_generate = True
3234
napoleon_google_docstring = False
3335

3436
# The suffix of source filenames.
@@ -78,6 +80,7 @@ def run_apidoc(_: Any) -> None:
7880
"--force",
7981
"--module-first",
8082
"--private",
83+
"--separate",
8184
"-o",
8285
docs_path.as_posix(),
8386
module_path.as_posix(),

src/array_api/latest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from ._2024_12 import * # noqa

src/array_api_compat/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any, Literal
22

3-
from array_api._2024_12 import Array, ArrayNamespaceFull
3+
from array_api.latest import Array, ArrayNamespaceFull
44

55
# return full namespace for convenience
66
# because optional attributes are not supported

tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import array_api_strict
55

6-
from array_api._2024_12 import ArrayNamespace
6+
from array_api.latest import ArrayNamespace
77

88

99
def test_strict_supset_namespace():

0 commit comments

Comments
 (0)