Skip to content

Commit 7d8f599

Browse files
authored
📝 docs: explain dynamic generation in docs (#119)
Signed-off-by: Nathaniel Starkman <[email protected]>
1 parent 92326ee commit 7d8f599

File tree

6 files changed

+72
-19
lines changed

6 files changed

+72
-19
lines changed

src/quaxed/__init__.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
"""Copyright (c) 2023 Nathaniel Starkman. All rights reserved.
1+
"""Quaxified `jax.scipy`.
2+
3+
This module wraps the functions in `jax.lax` with `quax.quaxify`. The wrapping
4+
happens dynamically through a module-level ``__dir__`` and ``__getattr__``. The
5+
list of available functions is in ``__all__`` and documented in the `jax.lax`
6+
library.
7+
8+
In addition the following modules are supported:
9+
10+
- `quaxed.lax.linalg`
11+
12+
The contents of these modules are likewise dynamically wrapped with
13+
`quax.quaxify` and their contents is listed in their respective ``__all__`` and
14+
documented in their respective libraries.
15+
16+
If a function is missing, please file an Issue.
217
3-
quaxed: Pre-quaxed libraries for multiple dispatch over abstract array types in JAX
418
"""
519
# pylint: disable=C0415,W0621
620

src/quaxed/array_api/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
"""Copyright (c) 2023 Nathaniel Starkman. All rights reserved.
1+
"""Quaxified `jax.experimental.array_api`.
2+
3+
Note that this module is deprecated in newer versions of JAX and importing
4+
`quaxed.array_api` may therefore raise an `ImportError`.
25
3-
quaxed: Pre-quaxed libraries for multiple dispatch over abstract array types in JAX
46
"""
57

68
# pylint: disable=redefined-builtin

src/quaxed/lax/__init__.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
"""Quaxed :mod:`jax.lax`."""
1+
"""Quaxified `jax.lax`.
2+
3+
This module wraps the functions in `jax.lax` with `quax.quaxify`. The wrapping
4+
happens dynamically through a module-level ``__dir__`` and ``__getattr__``. The
5+
list of available functions is in ``__all__`` and documented in the `jax.lax`
6+
library.
7+
8+
In addition the following modules are supported:
9+
10+
- `quaxed.lax.linalg`
11+
12+
The contents of these modules are likewise dynamically wrapped with
13+
`quax.quaxify` and their contents is listed in their respective ``__all__`` and
14+
documented in their respective libraries.
15+
16+
If a function is missing, please file an Issue.
17+
18+
"""
219
# pylint: disable=undefined-all-variable
320

421
__all__ = [

src/quaxed/numpy/__init__.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1-
"""Quaxed :mod:`jax.numpy`."""
1+
"""Quaxified `jax.numpy`.
2+
3+
This module wraps the functions in `jax.numpy` with `quax.quaxify`. The wrapping
4+
happens dynamically through a module-level ``__dir__`` and ``__getattr__``. The
5+
list of available functions is in ``__all__`` and documented in the `jax.numpy`
6+
library.
7+
8+
In addition the following modules are supported:
9+
10+
- `quaxed.numpy.fft`
11+
- `quaxed.numpy.linalg`
12+
13+
The contents of these modules are likewise dynamically wrapped with
14+
`quax.quaxify` and their contents is listed in their respective ``__all__`` and
15+
documented in their respective libraries.
16+
17+
If a function is missing, please file an Issue.
18+
19+
"""
220
# pylint: disable=redefined-builtin
321

422
from typing import Any
523

624
from jaxtyping import install_import_hook
725

8-
from . import _core, _creation_functions, _higher_order
26+
from . import _core, _creation_functions, _higher_order, fft, linalg
927
from ._creation_functions import *
1028
from ._higher_order import *
1129

12-
__all__: list[str] = []
13-
__all__ += _core.__all__
14-
__all__ += _higher_order.__all__
15-
__all__ += _creation_functions.__all__
30+
__all__ = (
31+
["fft", "linalg"] # noqa: RUF005
32+
+ _core.__all__
33+
+ _higher_order.__all__
34+
+ _creation_functions.__all__
35+
)
1636

1737

1838
# TODO: consolidate with ``_core.__getattr__``.

src/quaxed/operator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
"""Quaxed :external:`operator`.
1+
"""Quaxed `operator`.
22
3-
This module wraps the functions in :external:`operator` with
4-
:external:`quax.quaxify`. The wrapping happens dynamically through a
5-
module-level ``__dir__`` and ``__getattr__``. The list of available functions is
6-
in ``__all__`` and documented in the built-in :external:`operator` library.
3+
This module wraps the functions in `operator` with `quax.quaxify`. The wrapping
4+
happens dynamically through a module-level ``__dir__`` and ``__getattr__``. The
5+
list of available functions is in ``__all__`` and documented in the built-in
6+
`operator` library.
77
88
"""
99

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)