File tree Expand file tree Collapse file tree 5 files changed +14
-16
lines changed Expand file tree Collapse file tree 5 files changed +14
-16
lines changed Original file line number Diff line number Diff line change 1- <h1 align =' center ' > array-api-typing </h1 >
2- <h3 align =" center " >Type Annotations for the Array APi </h3 >
1+ <h1 align =" center " > array-api-typing </h1 >
2+ <h3 align =" center " >Type Annotations for the Python array API standard </h3 >
33
44---
55
@@ -21,7 +21,7 @@ uv add array-api-typing
2121 <summary >from source, using pip</summary >
2222
2323``` bash
24- pip install git+https://https:// github.com/data-apis/array-api-typing.git
24+ pip install git+https://github.com/data-apis/array-api-typing.git
2525```
2626
2727</details >
@@ -30,7 +30,7 @@ pip install git+https://https://github.com/data-apis/array-api-typing.git
3030
3131``` bash
3232cd /path/to/parent
33- git clone https://https:// github.com/data-apis/array-api-typing.git
33+ git clone https://github.com/data-apis/array-api-typing.git
3434cd array-api-typing
3535pip install -e . # editable mode
3636```
@@ -43,7 +43,7 @@ pip install -e . # editable mode
4343>>> import array_api_typing as xpt
4444>>> import numpy as np
4545
46- >>> def func (x : xpt.HasNamespace ) -> xpt.HasNamespace :
46+ >>> def func (x : xpt.HasArrayNamespace ) -> xpt.HasArrayNamespace :
4747... return x
4848
4949>>> func(np.array([1 , 2 , 3 ]))
Original file line number Diff line number Diff line change 1111 pattern = "src/**/*.py" ,
1212)
1313
14- pytest_collect_file = (readme_tester + python_file_tester ).pytest ()
14+ pytest_collect_file = (readme_tester + python_file_tester ).pytest ()
Original file line number Diff line number Diff line change 5050 " pytest-cov>=3" ,
5151 " pytest-github-actions-annotate-failures>=0.3.0" ,
5252 " sybil>=8.0.0" ,
53- ]
53+ ]
5454
5555
5656[tool .hatch ]
Original file line number Diff line number Diff line change 11"""Static typing support for the array API standard."""
22
3- __all__ = ["HasNamespace " ]
3+ __all__ = ["HasArrayNamespace" , "__version__" , "__version_tuple__ " ]
44
5- from ._version import version as __version__ , version_tuple as __version_tuple__
6- from ._namespace import HasNamespace
5+ from ._namespace import HasArrayNamespace
6+ from ._version import version as __version__ , version_tuple as __version_tuple__
Original file line number Diff line number Diff line change 11"""Static typing support for the array API standard."""
22
3- __all__ = ["HasNamespace " ]
3+ __all__ = ["HasArrayNamespace " ]
44
55from types import ModuleType
66from typing import Protocol , final
1010
1111
1212@final
13- class HasNamespace (Protocol [T ]): # type: ignore[misc] # see python/mypy#17288
13+ class HasArrayNamespace (Protocol [T ]): # type: ignore[misc] # see python/mypy#17288
1414 """Protocol for classes that have an `__array_namespace__` method.
1515
16- This is for type-annotating objects that should
17-
1816 Example:
1917 >>> import array_api_typing as xpt
2018 >>>
@@ -23,9 +21,9 @@ class HasNamespace(Protocol[T]): # type: ignore[misc] # see python/mypy#17288
2321 ... return object()
2422 >>>
2523 >>> x = MyArray()
26- >>> def has_namespace (x: xpt.HasNamespace ) -> bool:
24+ >>> def has_array_namespace (x: xpt.HasArrayNamespace ) -> bool:
2725 ... return hasattr(x, "__array_namespace__")
28- >>> has_namespace (x)
26+ >>> has_array_namespace (x)
2927 True
3028
3129 """
You can’t perform that action at this time.
0 commit comments