-
Notifications
You must be signed in to change notification settings - Fork 225
Fix missing class members in generated documentation #1230
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
base: main
Are you sure you want to change the base?
Fix missing class members in generated documentation #1230
Conversation
Fixes NVIDIA#1215 and NVIDIA#1100 After switching to nvidia-sphinx-theme in PR NVIDIA#874, class members (properties, methods, attributes) were no longer being documented in the generated HTML pages. This affected DeviceProperties and other classes using the autosummary class template. Root cause: The autoclass directive in the template was not configured to document members. Added :members:, :undoc-members:, and :show-inheritance: options to ensure all class members are properly documented. Changes: - Added :members: option to include all class members - Added :undoc-members: to include members without docstrings - Added :show-inheritance: to display base classes This restores the documentation to how it appeared before the theme switch (see v0.3.2 for comparison).
cpcloud
left a comment
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.
Thanks!
|
/ok to test |
@cpcloud, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
|
/ok to test 1ae0ef0 |
|
cpcloud
left a comment
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.
Attributes are still not showing up on the right hand side of the page here: https://nvidia.github.io/cuda-python/pr-preview/pr-1230/cuda-core/latest/generated/cuda.core.experimental._device.DeviceProperties.html#cuda.core.experimental._device.DeviceProperties
Description
Fixes #1215 and #1100
After switching to nvidia-sphinx-theme in PR #874, class members (properties, methods, attributes) were no longer being documented in the generated HTML pages. This affected
DevicePropertiesand other classes using the autosummary class template.Root Cause
The
autoclassdirective in the template (cuda_core/docs/source/_templates/autosummary/class.rst) was not configured to document members. Without the:members:option, Sphinx's autodoc extension only generates the class signature but no member documentation.Changes
Added three Sphinx autodoc options to the class template:
:members:- Include all class members in the documentation:undoc-members:- Include members without docstrings:show-inheritance:- Display base classesTesting
This change affects all classes documented using the autosummary class template. The fix restores member documentation to how it appeared before the theme switch (compare with v0.3.2 documentation).
Example affected classes:
DeviceProperties(153 properties)Deviceand other classes using the templateBefore/After
Before (current): DeviceProperties page shows only the class docstring with no attributes listed.
After (with this fix): DeviceProperties page shows all 153 property attributes with their docstrings, matching the v0.3.2 documentation format.