Skip to content
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

Class __init__ docstrings don't go into docs #189

Closed
svank opened this issue Jun 24, 2024 · 1 comment · Fixed by #194
Closed

Class __init__ docstrings don't go into docs #189

svank opened this issue Jun 24, 2024 · 1 comment · Fixed by #194
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@svank
Copy link
Contributor

svank commented Jun 24, 2024

I just saw this problem with my own docs, and I was checking here to see if you had a solution, since I copied your docs setup. When a class has a docstring and its __init__ also has a docstring, only the class docstring goes into the docs, and the __init__ docstring gets eaten. See, e.g., FunctionalCorrector, whose __init__ docstring goes nowhere. This means the input arguments to the class constructor don't get documented.

One solution is to add autoapi_python_class_content = 'both' to docs/source/conf.py, to concatenate the __init__ docstring to the class docstring

@svank svank added the documentation Improvements or additions to documentation label Jun 24, 2024
@jmbhughes
Copy link
Member

Thanks. I'll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants