From f0e337a4960c3fdb3e58c69edf2253c188cd2814 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:05:52 -0500 Subject: [PATCH] Always show type hints in docs (#31) (#34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 a46b3d1c97262e72cead0f83509b4a693b13d05e) Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> --- docs/_templates/autosummary/class.rst | 1 + docs/_templates/autosummary/function.rst | 5 ----- docs/conf.py | 6 +++--- 3 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 docs/_templates/autosummary/function.rst diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst index a2481c8..175b08f 100644 --- a/docs/_templates/autosummary/class.rst +++ b/docs/_templates/autosummary/class.rst @@ -10,6 +10,7 @@ .. autoclass:: {{ objname }} :no-members: :no-inherited-members: + :no-special-members: :show-inheritance: {% block attributes_summary %} diff --git a/docs/_templates/autosummary/function.rst b/docs/_templates/autosummary/function.rst deleted file mode 100644 index e03319b..0000000 --- a/docs/_templates/autosummary/function.rst +++ /dev/null @@ -1,5 +0,0 @@ -{{ objname | escape | underline}} - -.. currentmodule:: {{ module }} - -.. auto{{ objtype }}:: {{ objname }} diff --git a/docs/conf.py b/docs/conf.py index f49c5eb..6106d5d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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,