forked from data-apis/array-api-extra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: add numpydoc to pre-commit (data-apis#67)
* DEV: add numpydoc to pre-commit * update lockfile
- Loading branch information
1 parent
46df1c3
commit 62f4ac3
Showing
13 changed files
with
243 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"""Sphinx config.""" | ||
|
||
import importlib.metadata | ||
from typing import Any | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Modules housing private functions.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
"""Static type stubs for `_compat.py`.""" | ||
|
||
from types import ModuleType | ||
|
||
from ._typing import Array, Device | ||
|
||
# pylint: disable=missing-class-docstring,unused-argument | ||
|
||
class ArrayModule(ModuleType): | ||
def device(self, x: Array, /) -> Device: ... | ||
class ArrayModule(ModuleType): # numpydoc ignore=GL08 | ||
def device(self, x: Array, /) -> Device: ... # numpydoc ignore=GL08 | ||
|
||
def array_namespace( | ||
*xs: Array, | ||
api_version: str | None = None, | ||
use_compat: bool | None = None, | ||
) -> ArrayModule: ... | ||
def device(x: Array, /) -> Device: ... | ||
) -> ArrayModule: ... # numpydoc ignore=GL08 | ||
def device(x: Array, /) -> Device: ... # numpydoc ignore=GL08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
"""Static typing helpers.""" | ||
|
||
from types import ModuleType | ||
from typing import Any | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Allow for relative imports in test_vendor.py | ||
"""Allow for relative imports in `test_vendor.py`.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# This file is a hook imported by src/array_api_extra/_lib/_compat.py | ||
"""This file is a hook imported by `src/array_api_extra/_lib/_compat.py`.""" | ||
|
||
from .array_api_compat import * # noqa: F403 | ||
from .array_api_compat import array_namespace as array_namespace_compat | ||
|
||
|
||
# Let unit tests check with `is` that we are picking up the function from this module | ||
# and not from the original array_api_compat module. | ||
def array_namespace(*xs, **kwargs): | ||
def array_namespace(*xs, **kwargs): # numpydoc ignore=GL08 | ||
return array_namespace_compat(*xs, **kwargs) |