Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.28k stars 2.37k forks source link

Fix documentation for utils.optionals data values #13098

Closed Eric-Arellano closed 2 months ago

Eric-Arellano commented 2 months ago

We're adding proper support to .. py:data:: to docs.quantum.ibm.com. However, we cannot easily handle .. py:data:: being inside a table - it would complicate both the code and visual design.

So, this PR removes the table and uses .. py:data:: like we use it everywhere else in Qiskit.

qiskit-bot commented 2 months ago

One or more of the following people are relevant to this code:

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10726568515

Details


Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 2 88.43%
crates/qasm2/src/lex.rs 4 92.23%
qiskit/synthesis/two_qubit/xx_decompose/decomposer.py 6 90.84%
crates/qasm2/src/parse.rs 12 96.69%
<!-- Total: 24 -->
Totals Coverage Status
Change from base Build 10725151093: -0.02%
Covered Lines: 72578
Relevant Lines: 81428

💛 - Coveralls
Eric-Arellano commented 2 months ago

Eric-Arellano modified the milestones: 0.46.3, 1.2.1

I made a change so that the docs conversion script can now tolerate .. py:data:: inside tables. But it will preserve the current behavior. Rather than using the new colored bar like the first image, it will still be the table in the second image. Anchor links also will not work to these values - you'll go to the correct page (no 404), but won't go to the correct section.

image

Screenshot 2024-09-05 at 3 48 08 PM

Feel free to cherry-pick this to 0.46 and 1.2, but it's also okay if we only fix 1.3+.

jakelishman commented 2 months ago

tbh the table form wasn't really proper Sphinx anyway from a semantic perspective. I think at the time these were added, that was the best way I could come up with something legible in the existing (pre Furo) theme. The new form in this PR is "proper" Sphinx, so good to stick with that.

jakelishman commented 2 months ago

@Mergifyio backport stable/0.46 stable/1.2

mergify[bot] commented 2 months ago

backport stable/0.46 stable/1.2

✅ Backports have been created

* [#13101 Fix documentation for utils.optionals data values (backport #13098)](https://github.com/Qiskit/qiskit/pull/13101) has been created for branch `stable/0.46` but encountered conflicts * [#13102 Fix documentation for utils.optionals data values (backport #13098)](https://github.com/Qiskit/qiskit/pull/13102) has been created for branch `stable/1.2`