Skip to content

Commit

Permalink
Always show type hints in docs (#31) (#34)
Browse files Browse the repository at this point in the history
Before, we would only show type hints for parameters that had dedicated docstring. There are a lot of parameters that don't have docstring—and sometimes don't need it because it's obvious—so it's best to no matter what show the docstring.

This PR aligns the autodoc templates and config with the other addons like cutting.

(cherry picked from commit a46b3d1)

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
  • Loading branch information
mergify[bot] and Eric-Arellano authored Nov 7, 2024
1 parent 472badc commit f0e337a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.. autoclass:: {{ objname }}
:no-members:
:no-inherited-members:
:no-special-members:
:show-inheritance:

{% block attributes_summary %}
Expand Down
5 changes: 0 additions & 5 deletions docs/_templates/autosummary/function.rst

This file was deleted.

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@
.. |version| replace:: {release}
"""

# Options for autodoc. These reflect the values from Terra.
# Options for autodoc. These reflect the values from Qiskit SDK and Runtime.
autosummary_generate = True
autosummary_generate_overwrite = False
autoclass_content = "both"
autodoc_typehints = "description"
autodoc_typehints_description_target = "documented_params"
autodoc_member_order = "bysource"
autodoc_default_options = {
"inherited-members": None,
}
napoleon_google_docstring = True
napoleon_numpy_docstring = False


# This adds numbers to the captions for figures, tables,
Expand Down

0 comments on commit f0e337a

Please sign in to comment.