-
Notifications
You must be signed in to change notification settings - Fork 34
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
Show class members #702
Show class members #702
Conversation
Pull Request Test Coverage Report for Build 11667974979Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@@ -0,0 +1,33 @@ | |||
{# |
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.
This is copied from Qiskit SDK, other than where I comment. I'm probably going to update Qiskit to mirror this
:no-inherited-members: | ||
:no-special-members: |
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.
We have to set this to avoid the methods being duplicated. That's because we configured .. autoclass
in conf.py
to now show inherited members
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.
This was already unused
|
||
.. autoclass:: WeightType |
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.
This class is tiny, so I think it's fine to keep inlined
napoleon_google_docstring = True | ||
napoleon_numpy_docstring = False |
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.
This is a performance enhancement for build-time
|
||
For each element of the list, it means that the :class:`~qiskit.quantum_info.Pauli` is given by | ||
the ``j``th commuting observable in the ``i``th group. | ||
the ``j``-th commuting observable in the ``i``-th group. |
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.
The lack of -
was causing a Sphinx error
allowlist_externals = | ||
rm | ||
commands = | ||
rm -rf {toxinidir}/docs/stubs/ {toxinidir}/docs/_build/ |
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.
This is fine, but also mostly noting: there is already some cleaning that goes on in the docs
environment. We could potentially remove it with this.
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.
Ack, I noticed that. It only deletes .doctrees
inside html
rather than the entire folder, however. I also think it's nice to have tox -e docs-clean
to be consistent with the other addon repos - muscle memory.
Lmk if you want me to delete this though. I'm fine with that
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.
Sorry, I meant that we could potentially remove those steps from the docs
environment now that there is docs-clean.
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, yeah I agree. There are many times where you do want the caching to be preserved. Updated
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.
This looks good to me
We weren't showing class members (attributes & methods) for inlined classes. This is fixed by setting `"inherited-members": None` in `autodoc_default_options`. Notably, we now show inherited members for classes like `instructions.Move`. I recommend this because users want to know every function/attribute defined on the object, and they don't really care about the origin of that functionality. Qiskit SDK takes this approach, which is useful with e.g. the circuit library. With this change, some of the classes end up being much larger. So, we un-inline them and move them back to being their own pages in `stubs/`. This means we remove their client redirects. This PR also makes some other enhancements: * Adds `tox -e docs-clean` * Displays type hints in the `parameters` section, rather than inline to the signature. This matches the style of the other API projects (cherry picked from commit 0ecc244)
We weren't showing class members (attributes & methods) for inlined classes. This is fixed by setting `"inherited-members": None` in `autodoc_default_options`. Notably, we now show inherited members for classes like `instructions.Move`. I recommend this because users want to know every function/attribute defined on the object, and they don't really care about the origin of that functionality. Qiskit SDK takes this approach, which is useful with e.g. the circuit library. With this change, some of the classes end up being much larger. So, we un-inline them and move them back to being their own pages in `stubs/`. This means we remove their client redirects. This PR also makes some other enhancements: * Adds `tox -e docs-clean` * Displays type hints in the `parameters` section, rather than inline to the signature. This matches the style of the other API projects (cherry picked from commit 0ecc244) Co-authored-by: Eric Arellano <[email protected]>
We weren't showing class members (attributes & methods) for inlined classes. This is fixed by setting
"inherited-members": None
inautodoc_default_options
.Notably, we now show inherited members for classes like
instructions.Move
. I recommend this because users want to know every function/attribute defined on the object, and they don't really care about the origin of that functionality. Qiskit SDK takes this approach, which is useful with e.g. the circuit library.With this change, some of the classes end up being much larger. So, we un-inline them and move them back to being their own pages in
stubs/
. This means we remove their client redirects.This PR also makes some other enhancements:
tox -e docs-clean
parameters
section, rather than inline to the signature. This matches the style of the other API projects