-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed namespace fix to use Sphinx autodoc-process-* events #7103
Conversation
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
Documentation CI was already failing in previous commits. The following packages have unmet dependencies:
cmake : Depends: libssl1.1 (>= 1.1.1) but it is not installable The following is the function installing docs dependencies. Lines 338 to 375 in 0ae7b1a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timohl This is great! Thanks!
We are moving away from the *Inject
functions to simplify writing docstrings.
Type
Motivation and Context
Open3D uses namespaces
open3d.cpu.pybind.
andopen3d.cuda.pybind.
to differentiate between both device builds.This adds a lot of clutter to the documentation (see screenshots below).
There is already a partial fix for functions documented using
docstring::ClassMethodDocInject
anddocstring::FunctionDocInject
.However, a big part of Open3D does not use those functions for documentation and #7081 removed those from the contribute docs (so they should probably be avoided in the future).
Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
This PR moves the namespace fix away from
docstring::ClassMethodDocInject
anddocstring::FunctionDocInject
to the sphinx documentation generation.It uses the autodoc events
autodoc-process-signature
andautodoc-process-docstring
to change namespaces toopen3d.
during doc generation.With this PR all namespaces are fixed in the documentation (checked using the search function).
This is a fix used in #6917 since mypy would complain about missing imports for functions with fixed namespaces.
Notice in the following before/after screenshots that the namespaces in the
clear
function were already fixed due to usingdocstring::ClassMethodDocInject
. This PR improves the namespaces in__init__
andas_tensor
though, resulting in better readability.Here before:
and after: