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

`DefaultStyle` documentation formatting issues #11037

Open 1ucian0 opened 1 year ago

1ucian0 commented 1 year ago

The qiskit.visualization.qcstyle.DefaultStyle documentation is slightly broken

Screenshot 2023-10-18 at 12 30 02

Notice that parameters are not listed properly. Compare with others:

Screenshot 2023-10-18 at 12 33 15

The DefaultStyle documentation formatting needs to be fixed.

RasmitDevkota commented 1 year ago

I am interested in solving this issue - it looks like the arguments documentation for DefaultStyle is simply missing a list header Args:, which I presume to be the issue.

AngeloDanducci commented 1 year ago

@RasmitDevkota assigned, thanks for the help!

Eric-Arellano commented 1 year ago

@RasmitDevkota, the fix isn't https://github.com/Qiskit/documentation/pull/271. It's instead going to look like updating the file qiskit/visualization/circuit/qcstyle.py. You want its docstring to look more like circuit_drawer from qiskit/visualization/circuit/circuit_visualization.py, how each argument is surrounded by **

You can remove the **Style Dict Details** portion of the docstring. It's not necessary.

It looks like the arguments documentation for DefaultStyle is simply missing a list header Args:

No, that is what gets added automatically by Sphinx (via Autodoc) when you are listing arguments to a function. This is different. We are explaining the options that you can specify in the dictionary argument; that is, it's a single argument that is a dictionary.

The issue is how qcstyle.py doesn't use the same formatting as circuit_visualization.py.

aabennak commented 11 months ago

I'm interested in this simple task. May I contribute to this?

aabennak commented 10 months ago

I apologize for staying off this topic for a handful of days. I have already made the changes to the commented out section, but I just wanted to make sure of it before I submit the pull request: I'm assuming that Sphinx would generate the html page documentation from the commented out chunk under the DefualtStyle class?

Also is there a need to go through the tox part if all that I did was edit the comment section?

jakelishman commented 10 months ago

No need to apologise for a delay - take whatever time you need.

Running tox and whatnot isn't a formal requirement, it's just meant to be a convenience so you can build the documentation yourself locally if you like. All our code-quality checks are automated whenever you make a PR, so you can't forget anything. The PR test suite will also build the documentation in a way that you can download it afterwards to check, if you're having problems building it locally.

1ucian0 commented 3 months ago

Affects 0.46 https://docs.quantum.ibm.com/api/qiskit/0.46/qiskit.visualization.circuit.qcstyle.DefaultStyle#defaultstyle

Eric-Arellano commented 3 months ago

@1ucian0 it looks like this page does not exist in 1.0+? If so, I recommend closing this issue. Not worth the time improving 0.46 docs.