Fix qiskit.circuit
method header and broken cross-reference (backport #12394)
#12424
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of Qiskit/documentation#1275
The
__array__
method has a wrong header in the API docs (as we can see in the following screenshot) because Sphinx is not able to set the correct id in the generated HTML for methods starting with double underscore. Instead, Sphinx truncates the name toarray__
.This PR changes the method to be instead
builtins.__array__
, and it also fixes a broken reference forInstruction.params
. The cross-reference was broken due to the.. currentmodule:: None
directive.This is the result of Sphinx after this PR:
The API docs will have the correct header because we only use the part after the last dot in the id.
The PR will need backport to
stable/1.1
This is an automatic backport of pull request #12394 done by Mergify.