Skip to content

Commit 7c5958f

Browse files
nstarmanjorenham
andcommitted
Apply suggestions from code review
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com> Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
1 parent 72b39f4 commit 7c5958f

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1 align='center'> array-api-typing </h1>
1+
<h1 align="center"> array-api-typing </h1>
22
<h3 align="center">Type Annotations for the Array APi</h3>
33

44
---
@@ -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
3232
cd /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
3434
cd array-api-typing
3535
pip 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]))

conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
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()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
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]

src/array_api_typing/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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__

src/array_api_typing/_namespace.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Static typing support for the array API standard."""
22

3-
__all__ = ["HasNamespace"]
3+
__all__ = ["HasArrayNamespace"]
44

55
from types import ModuleType
66
from typing import Protocol, final
@@ -10,7 +10,7 @@
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
1616
This is for type-annotating objects that should
@@ -23,7 +23,7 @@ class HasNamespace(Protocol[T]): # type: ignore[misc] # see python/mypy#17288
2323
... return object()
2424
>>>
2525
>>> x = MyArray()
26-
>>> def has_namespace(x: xpt.HasNamespace) -> bool:
26+
>>> def has_namespace(x: xpt.HasArrayNamespace) -> bool:
2727
... return hasattr(x, "__array_namespace__")
2828
>>> has_namespace(x)
2929
True

0 commit comments

Comments
 (0)