To fix the type hints, we have to stop using sphinx-autodoc-typehints and instead use autodoc's builtin support for type hints. I didn't realize we were still using sphinx-autodoc-typehints - the other Qiskit projects migrated off a while ago.
This PR also makes some other improvements to align with changes we made in Qiskit Addons & qiskit-ibm-transpiler:
always show inheritance in class pages for the base class
index page should show the PyPI package name in code syntax
don't show signatures in autosummary tables, since they're noisy
show type hints for parameters that don't have docstring
Introduces a regression: type hints for properties
Unfortunately, switching off of sphinx-autodoc-typehints results in https://github.com/Qiskit/documentation/issues/2346. This is a quirk of autosummary that we cannot easily fix. We have a plan to fix it, although realistically won't get to it until Q1 and possibly Q2.
In the meantime, consider repeating some of the type information in the docstring. For example, in
<Attribute id="qiskit_ibm_runtime.EstimatorV2.mode">
Return the execution mode used by this primitive.
You could rewrite to say
<Attribute id="qiskit_ibm_runtime.EstimatorV2.mode">
Return the execution mode used by this primitive, either :class:~`.Session` or ~:class:~`.Batch`.
Closes https://github.com/Qiskit/qiskit-ibm-runtime/issues/1877. We now use
EstimatorPubLike
andSamplerPubLike
for the type hints, rather than Sphinx fully expanding the types into extremely long values shown in #1877.To fix the type hints, we have to stop using
sphinx-autodoc-typehints
and instead use autodoc's builtin support for type hints. I didn't realize we were still usingsphinx-autodoc-typehints
- the other Qiskit projects migrated off a while ago.This PR also makes some other improvements to align with changes we made in Qiskit Addons & qiskit-ibm-transpiler:
autosummary
tables, since they're noisyIntroduces a regression: type hints for properties
Unfortunately, switching off of
sphinx-autodoc-typehints
results in https://github.com/Qiskit/documentation/issues/2346. This is a quirk of autosummary that we cannot easily fix. We have a plan to fix it, although realistically won't get to it until Q1 and possibly Q2.In the meantime, consider repeating some of the type information in the docstring. For example, in
You could rewrite to say