Skip to content

Commit

Permalink
feat: add missing __all__ definitions to .pyi files
Browse files Browse the repository at this point in the history
  • Loading branch information
antalsz committed Jan 9, 2025
1 parent 0ac68f2 commit 573d537
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 0 deletions.
12 changes: 12 additions & 0 deletions quil-py/quil/expression/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ from typing import Dict, Optional, Sequence, Union, final

from quil.instructions import MemoryReference

__all__ = [
'Expression',
'FunctionCallExpression',
'InfixExpression',
'PrefixExpression',
'ExpressionFunction',
'PrefixOperator',
'InfixOperator',
'EvaluationError',
'ParseExpressionError',
]

class EvaluationError(ValueError):
"""Error that may occur while evaluation an ``Expression``."""

Expand Down
78 changes: 78 additions & 0 deletions quil-py/quil/instructions/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,84 @@ from typing_extensions import Self

from quil.expression import Expression

__all__ = [
'Instruction',
'Arithmetic',
'ArithmeticOperand',
'ArithmeticOperator',
'BinaryLogic',
'BinaryOperand',
'BinaryOperator',
'Call',
'CallArgument',
'Comparison',
'ComparisonOperand',
'ComparisonOperator',
'Convert',
'Exchange',
'ExternParameter',
'ExternParameterType',
'ExternSignature',
'Move',
'UnaryLogic',
'UnaryOperator',
'Calibration',
'CalibrationIdentifier',
'CircuitDefinition',
'MeasureCalibrationDefinition',
'MeasureCalibrationIdentifier',
'Declaration',
'Load',
'Offset',
'Sharing',
'Store',
'ScalarType',
'Vector',
'Measurement',
'Include',
'Pragma',
'PragmaArgument',
'AttributeValue',
'Capture',
'FrameDefinition',
'FrameIdentifier',
'Pulse',
'RawCapture',
'SetFrequency',
'SetPhase',
'SetScale',
'ShiftFrequency',
'ShiftPhase',
'SwapPhases',
'Gate',
'GateDefinition',
'GateModifier',
'GateSpecification',
'PauliGate',
'PauliTerm',
'PauliSum',
'Jump',
'JumpWhen',
'JumpUnless',
'Label',
'Target',
'TargetPlaceholder',
'Measurement',
'MemoryReference',
'Qubit',
'QubitPlaceholder',
'Reset',
'Delay',
'Fence',
'Waveform',
'WaveformDefinition',
'WaveformInvocation',
'CallError',
'ExternError',
'GateError',
'ParseMemoryReferenceError',
]

@final
class Instruction:
"""A Quil instruction. Each variant corresponds to a possible type of Quil instruction.
Expand Down
20 changes: 20 additions & 0 deletions quil-py/quil/program/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ from quil.instructions import (
Waveform,
)

__all__ = [
'FrameSet',
'Program',
'CalibrationExpansion',
'CalibrationExpansionSourceMap',
'CalibrationExpansionSourceMapEntry',
'CalibrationSource',
'MaybeCalibrationExpansion',
'ProgramCalibrationExpansion',
'ProgramCalibrationExpansionSourceMap',
'ProgramCalibrationExpansionSourceMapEntry',
'CalibrationSet',
'MemoryRegion',
'BasicBlock',
'ControlFlowGraph',
'ScheduleSeconds',
'ScheduleSecondsItem',
'TimeSpanSeconds',
]

@final
class Program:
@staticmethod
Expand Down
4 changes: 4 additions & 0 deletions quil-py/quil/validation/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from . import identifier as identifier

__all__ = [
'identifier',
]
6 changes: 6 additions & 0 deletions quil-py/quil/validation/identifier.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
__all__ = [
'IdentifierValidationError',
'validate_identifier',
'validate_user_identifier',
]

class IdentifierValidationError(ValueError):
"""Errors that may occur when validating a Quil identifier."""

Expand Down
9 changes: 9 additions & 0 deletions quil-py/quil/waveforms/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
from typing import Iterable

__all__ = [
'BoxcarKernel',
'ErfSquare',
'Gaussian',
'DragGaussian',
'HermiteGaussian',
'apply_phase_and_detuning',
]

def apply_phase_and_detuning(iq_values: Iterable[complex], phase: float, detuning: float, sample_rate: float):
"""Modulate and phase shift waveform IQ data in place."""
...
Expand Down

0 comments on commit 573d537

Please sign in to comment.