You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/developers/documentation.rst
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,21 @@ Documentation
6
6
Python API documentation
7
7
------------------------
8
8
9
-
to document:
9
+
.. note::
10
10
11
-
- Python doc style
12
-
- ``.pyi`` stub files generation & usage
13
-
- Sphinx autodocs/module used
11
+
TODO: document the Python doc style we use.
12
+
13
+
We add `docstrings for pybind11-created types and functions <https://pybind11.readthedocs.io/en/stable/basics.html#creating-bindings-for-a-simple-function>`__.
14
+
In order to retrieve those, one usually would need to build pyAMReX and have it available (installed) as a working Python import.
15
+
This build step can be complicated for building documentation and it does not work well with autocompletion in IPython.
16
+
17
+
Thus, on every merge to the mainline ``development`` branch, we build pyAMReX and create "stub" (interface/facade) files that carry all type information and doc strings.
18
+
We do this by building pyAMReX and running the script ``.github/update_stub.sh``, which uses `pybind11-stubgen <https://github.com/sizmailov/pybind11-stubgen>`__ to extract these information.
19
+
A GitHub action then commits the updated stub files (``.pyi``) to the repository.
20
+
21
+
When we build our Sphinx documentation, we copy the ``.pyi`` files and generate documentation of classes and functions via `autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`__.
22
+
The logic for this resides in ``docs/source/conf.py``.
23
+
We also provide a zip archive online under https://pyamrex.readthedocs.io/en/latest/_static/pyapi/amrex.zip that can be downloaded by dependent projects that build their Sphinx docs.
0 commit comments