-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Document Primitives types #14348
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
base: main
Are you sure you want to change the base?
Document Primitives types #14348
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 15097493208Warning: 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 |
@Eric-Arellano What do you suggest to do with things that look like this? |
@Eric-Arellano The screenshot is with EstimatorPubLike = Union[
EstimatorPub,
Tuple[QuantumCircuit, ObservablesArrayLike],
Tuple[QuantumCircuit, ObservablesArrayLike, BindingsArrayLike],
Tuple[QuantumCircuit, ObservablesArrayLike, BindingsArrayLike, Real],
] So this is what I want the users to see in the documentation. |
Looking more at https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_type_aliases, I think that Sphinx option will only help when the types are used as type hints in a function. In your PR, you are using Rather than using ``ParameterLike``:
.. code-block:: python
EstimatorPub |
tuple[QuantumCircuit, ObservablesArrayLike] |
tuple[QuantumCircuit, ObservablesArrayLike, BindingsArrayLike] |
tuple[QuantumCircuit, ObservablesArrayLike, BindingsArrayLike, Real] |
Where to insert these lines? And, if this ever changes, will one have to remember to change the documentation too? |
You'll have to decide what makes the most sense. Probably in the same section headings where they are, but underneath the Maybe we should talk about this briefly in the weekly dev call tomorrow?
Unfortunately, yes. Matthew or Jake may have more clever ideas. I can't think of anything. |
Let's do something that we're happy with for
qiskit/qiskit/primitives/containers/sampler_pub.py Lines 172 to 193 in a18e151
Current I'd like to:
When we extend to other types, we should
All of the items listed above - I would very much appreciate help to accomplish them, from folks familiar with sphinx. Finally, note Issue #14397: it's pretty impossible to play with the documentation, when every build attempt takes 20 minutes. |
Summary
Closes #13969 and #14292.
SamplerPub
,EstimatorPub
,ParameterLike
,BindingsArray
,BindingsArrayLike
,ObservableLike
,ObservablesArray
, andObservablesArrayLike
are now all imported in the Primitives__init__
file, and are present in the auto-summaries in that file.Details and comments
I didn't add
BindingArray
toBindingsArrayLike
andObservablesArray
toObservablesArrayLike
because theseLike
types already include allArrayLike
.