-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sphinx documentation for the Python API #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @Mandrenkov! I downloaded and had a look at the rendered site, really impressive so far. Left some comments and thoughts, mostly minor.
I also had some other thoughts while reviewing which are out-of-scope, but just in case:
-
If you want the
index.rst
page to appear in the ToC, we found out later that this is possible since Sphinx supports links in the ToC directly e.g., see the PennyLane-Qiskit docs (the index page is listed as 'Overview' on the LHS). However, we never got around to propagating this elsewhere. -
The 'Key Concepts' and 'Getting Started' quick links on
index.rst
are broken -
Are the C++-Python pybind11 bindings documented anywhere? I clicked around but couldn't find them in either the C++ section or the Python API section 🤔 I thought Sphinx would be able to automatically extract them.
-
It would be good to offer minimal example usage within every user-facing docstring, a la NumPy. In particular, I found myself thinking this while looking at
jet.run_xir_program
. We find this important as:- over time, users will end up directly on the docstring page via a Google search, so it's the best place to provide usage information
- the example will also be physically close to the actual code, making it easy to remember to update when making changes in PRs
Co-authored-by: Josh Izaac <[email protected]>
Excellent comments! 💯
Ah, very nice! I played around with this but ultimately decided to keep the current layout since it matches PL and SF. Also, creating a separate ToC section for the landing page feels wasteful and having the overview under "Using Jet" looks out of place.
Fixed. 😅
I initially tried to generate API documentation for the Python bindings but couldn't figure out how to do it so I submitted the PR without them; however, after looking at it today, I was able to get it work so they should all be there now!
Agreed! I added some examples to the docstrings dealing with the XIR but the others will have to wait for a future PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. It turns out we need to remove the (prefixed) indentation from the Python binding docstrings. Furthermore, to better distinguish the different function overloads, I've put their signatures in bold and italics and separated them with divider lines. Now, overloaded functions looks like this: Similarly, overloaded methods look like this: |
@Mandrenkov looks great 🤩 |
Context:
Presently, the Jet documentation website only shows API documentation for the Jet C++ library despite the fact that the
jet
Python package is fully-featured and has additional functionality for modelling quantum circuits.Description of the Change:
jet
Python package under the "Python API" heading.Benefits:
jet
Python package.Possible Drawbacks:
Related GitHub Issues:
None.