Skip to content

Commit

Permalink
Set **kwargs type to KwargTypes where required
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdilkes committed Aug 10, 2023
1 parent 68d1fae commit 2d4fc4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions pytket/pytket/backends/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def rebase_pass(self) -> BasePass:

@abstractmethod
def default_compilation_pass(
self, optimisation_level: int = 2, **kwargs
self, optimisation_level: int = 2, **kwargs: KwargTypes
) -> BasePass:
"""
A suggested compilation pass that will will, if possible, produce an equivalent
Expand Down Expand Up @@ -173,7 +173,7 @@ def default_compilation_pass(
...

def get_compiled_circuit(
self, circuit: Circuit, optimisation_level: int = 2, **kwargs
self, circuit: Circuit, optimisation_level: int = 2, **kwargs: KwargTypes
) -> Circuit:
"""
Return a single circuit compiled with :py:meth:`default_compilation_pass` See
Expand All @@ -187,7 +187,10 @@ def get_compiled_circuit(
return return_circuit

def get_compiled_circuits(
self, circuits: Sequence[Circuit], optimisation_level: int = 2, **kwargs
self,
circuits: Sequence[Circuit],
optimisation_level: int = 2,
**kwargs: KwargTypes,
) -> List[Circuit]:
"""Compile a sequence of circuits with :py:meth:`default_compilation_pass`
and return the list of compiled circuits (does not act in place).
Expand Down
4 changes: 2 additions & 2 deletions pytket/tests/simulator/tket_sim_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def rebase_pass(self) -> BasePass:
return auto_rebase_pass(_GATE_SET)

def default_compilation_pass(
self, optimisation_level: int = 1, **kwargs
self, optimisation_level: int = 1, **kwargs: KwargTypes
) -> BasePass:
assert optimisation_level in range(3)
if optimisation_level == 0:
Expand Down Expand Up @@ -158,7 +158,7 @@ class TketSimShotBackend(TketSimBackend):
_supports_contextual_optimisation = True

def default_compilation_pass(
self, optimisation_level: int = 1, **kwargs
self, optimisation_level: int = 1, **kwargs: KwargTypes
) -> BasePass:
assert optimisation_level in range(3)
if optimisation_level == 0:
Expand Down

0 comments on commit 2d4fc4f

Please sign in to comment.