Skip to content

Sphinx doc gen excludes __init__ docstrings #1144

@EricSchrock

Description

@EricSchrock

I noticed that the current Sphinx documentation generation does not include docstrings from __init__ methods, which means some important documentation is being excluded from the readthedocs page.

Example: https://pyhealth.readthedocs.io/en/latest/api/datasets/pyhealth.datasets.ChestXray14Dataset.html

ChatGPT claims the solution is as simple as adding autoclass_content = "both" to conf.py.

Alternatively, it claims this should work.

.. autoclass:: pyhealth.datasets.ChestXray14Dataset
   :members:
   :special-members: __init__
   :undoc-members:
   :show-inheritance:

Or we could standardize on just using either the class docstring or the init doc string...

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions