Skip to content

Commit 8a5e501

Browse files
jeongseok-metafacebook-github-bot
authored andcommitted
Add Sphinx autodoc configuration for constructor documentation (#538)
Summary: Pull Request resolved: #538 Configure Sphinx autodoc to include constructor documentation in generated API docs, which currently not being generated as: This ensures that `__init__` methods and other special members are properly documented, addressing the issue where Python binding constructors were not appearing in the Sphinx-generated documentation. The configuration adds: - `'special-members': '__init__'` to include constructors - `'show-inheritance': True'` to display class hierarchy - `'members': True'` to include all class members - `'undoc-members': True'` to include members without explicit docstrings This complements the existing Python binding argument name fixes and ensures constructors are visible in the documentation even when detailed docstrings are not present in the pybind11 bindings. Sphinx doc: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_default_options Reviewed By: cdtwigg Differential Revision: D81549409 fbshipit-source-id: 59b6f20dae1e640acc2d156c132d0b9d038dad3c
1 parent e7f85e3 commit 8a5e501

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pymomentum/doc/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
"sphinx.ext.autodoc",
1010
]
1111

12+
# Configure autodoc to include constructors and other special methods
13+
autodoc_default_options = {
14+
"special-members": "__init__",
15+
"show-inheritance": True,
16+
"members": True,
17+
"undoc-members": True,
18+
}
19+
1220
exclude_patterns = [
1321
".pixi",
1422
"build",

0 commit comments

Comments
 (0)