-
Notifications
You must be signed in to change notification settings - Fork 48
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
Tidy up pytket.circuit
API docs
#1178
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
aa81203
don't clutter pytket.circuit docs by expanding submodules
CalMacCQ b4d74de
change caption
CalMacCQ c11c4ca
use bysource order for autodoc
CalMacCQ 0104fe8
start using automethod for Circuit methods
CalMacCQ 6a57997
fix typo
CalMacCQ 2dcbb37
use autodoc typehints
CalMacCQ e146082
Expand TOC for all pages
CalMacCQ cd31ca4
add some circuit properties
CalMacCQ 66a0c5b
delete unused config settings
CalMacCQ 009d4af
add another chunk of automethod boilerplate
CalMacCQ 68e5bc7
finish adding circuit methods
CalMacCQ 12cd295
add some notes on Circuit.add_gate
CalMacCQ f52971f
submodules -> classes
CalMacCQ 104e196
scrub ._tket from pytket.circuit docs source
CalMacCQ 3357da1
remove more _tket
CalMacCQ d182291
don't use sphinx_autodoc_typehints for now
CalMacCQ 134e6cd
remove non-existent Reset method
CalMacCQ 00d9e7e
use submodules rather than classes
CalMacCQ 4c45c85
don't show binary info in pytket.circuit doc
CalMacCQ dad668e
remove typehints extension entirely
CalMacCQ 4b31411
remove duplicate CV method
CalMacCQ b5a5270
remove more duplicate methods
CalMacCQ c6c46d1
submodules -> classes
CalMacCQ 78de3d4
reorder circuit properties
CalMacCQ e587ae1
remove duplicate properties
CalMacCQ f384377
remove :special-members: and use automethod for __init__ etc
CalMacCQ 5713962
Merge branch 'develop' into docs/tidy_pytket.circuit
CalMacCQ 3d992b7
remove __hash__
CalMacCQ abe76a4
minor spacing edit
CalMacCQ 7b0df5c
Revert "minor spacing edit"
CalMacCQ 4796185
add missing methods found by python script
CalMacCQ 126a707
Merge branch 'develop' into docs/tidy_pytket.circuit
CalMacCQ 53206d3
use autoproperty for created_qubits and discarded_qubits
CalMacCQ 62a2508
add script to check circuit methods and properties
CalMacCQ 278e8b5
fix typo
CalMacCQ 618c36d
remove comment
CalMacCQ a06c9b4
fix spaxing and heading
CalMacCQ 69382b3
consistent headings
CalMacCQ f4e259a
remove some dunder methods from API docs
CalMacCQ 9581168
add __rshift__ dunder method back into the docs
CalMacCQ fa99cb8
Merge branch 'develop' into docs/tidy_pytket.circuit
CalMacCQ cb09c7b
add explanatory comments
CalMacCQ 36a4265
remove spaces
CalMacCQ 4bc5285
Merge branch 'develop' into docs/tidy_pytket.circuit
CalMacCQ 0a3520b
Merge branch 'develop' into docs/tidy_pytket.circuit
CalMacCQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import inspect | ||
import re | ||
|
||
from pytket._tket.circuit import Circuit | ||
|
||
# This script is used to check that no methods or properties of | ||
# the Circuit class are left out in the circuit_class.rst file. | ||
|
||
with open("circuit_class.rst", "r", encoding="utf-8") as file: | ||
rst = file.read() | ||
|
||
in_methods = {p[0] for p in inspect.getmembers(Circuit)} | ||
pattern = re.compile(r"(?:\bautomethod\b|\bautoproperty\b):: (\w+)\n") | ||
in_docs = set(pattern.findall(rst)) | ||
missing = in_methods - in_docs | ||
print([s for s in missing if not s.startswith("_")]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ pytket.circuit | |
================================== | ||
.. toctree:: | ||
:caption: Classes: | ||
:maxdepth: 2 | ||
:maxdepth: 1 | ||
CalMacCQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
circuit_class.rst | ||
optype.rst | ||
|
@@ -14,106 +14,106 @@ pytket.circuit | |
|
||
.. automodule:: pytket._tket.circuit | ||
:members: fresh_symbol | ||
.. autoclass:: pytket._tket.circuit.Op | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all of this _tket stuff is replaced in the docs build anyway. I don't think theres any good reason for it to be in the rst source |
||
.. autoclass:: pytket.circuit.Op | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.Command | ||
.. autoclass:: pytket.circuit.Command | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.BasisOrder | ||
.. autoclass:: pytket.circuit.BasisOrder | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.CXConfigType | ||
.. autoclass:: pytket.circuit.CXConfigType | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.CircBox | ||
.. autoclass:: pytket.circuit.CircBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.Unitary1qBox | ||
.. autoclass:: pytket.circuit.Unitary1qBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.Unitary2qBox | ||
.. autoclass:: pytket.circuit.Unitary2qBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.Unitary3qBox | ||
.. autoclass:: pytket.circuit.Unitary3qBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ExpBox | ||
.. autoclass:: pytket.circuit.ExpBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.PauliExpBox | ||
.. autoclass:: pytket.circuit.PauliExpBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.PauliExpPairBox | ||
.. autoclass:: pytket.circuit.PauliExpPairBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ToffoliBox | ||
.. autoclass:: pytket.circuit.ToffoliBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.QControlBox | ||
.. autoclass:: pytket.circuit.QControlBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.CustomGateDef | ||
.. autoclass:: pytket.circuit.CustomGateDef | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.CustomGate | ||
.. autoclass:: pytket.circuit.CustomGate | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.Conditional | ||
.. autoclass:: pytket.circuit.Conditional | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ClassicalExpBox | ||
.. autoclass:: pytket.circuit.ClassicalExpBox | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.PhasePolyBox | ||
.. autoclass:: pytket.circuit.PhasePolyBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ProjectorAssertionBox | ||
.. autoclass:: pytket.circuit.ProjectorAssertionBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.StabiliserAssertionBox | ||
.. autoclass:: pytket.circuit.StabiliserAssertionBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.WASMOp | ||
.. autoclass:: pytket.circuit.WASMOp | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.MultiBitOp | ||
.. autoclass:: pytket.circuit.MultiBitOp | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.SetBitsOp | ||
.. autoclass:: pytket.circuit.SetBitsOp | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ClassicalEvalOp | ||
.. autoclass:: pytket.circuit.ClassicalEvalOp | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ClassicalOp | ||
.. autoclass:: pytket.circuit.ClassicalOp | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.CopyBitsOp | ||
.. autoclass:: pytket.circuit.CopyBitsOp | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.RangePredicateOp | ||
.. autoclass:: pytket.circuit.RangePredicateOp | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.MultiplexorBox | ||
.. autoclass:: pytket.circuit.MultiplexorBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.MultiplexedRotationBox | ||
.. autoclass:: pytket.circuit.MultiplexedRotationBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.MultiplexedU2Box | ||
.. autoclass:: pytket.circuit.MultiplexedU2Box | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.MultiplexedTensoredU2Box | ||
.. autoclass:: pytket.circuit.MultiplexedTensoredU2Box | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.StatePreparationBox | ||
.. autoclass:: pytket.circuit.StatePreparationBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.DiagonalBox | ||
.. autoclass:: pytket.circuit.DiagonalBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ConjugationBox | ||
.. autoclass:: pytket.circuit.ConjugationBox | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ResourceBounds | ||
.. autoclass:: pytket.circuit.ResourceBounds | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.ResourceData | ||
.. autoclass:: pytket.circuit.ResourceData | ||
:special-members: | ||
:members: | ||
.. autoclass:: pytket._tket.circuit.DummyBox | ||
.. autoclass:: pytket.circuit.DummyBox | ||
:special-members: | ||
:members: |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we put a couple of lines of commentary at the top of this file to explain what it does and why?
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.
Done.