Skip to content

Commit 335ec9f

Browse files
committed
Ruff format changes black is fine with
1 parent eb1232a commit 335ec9f

96 files changed

Lines changed: 192 additions & 70 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev_tools/qualtran_dev_tools/all_call_graph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Generate the library-wide call graph from all bloq examples."""
16+
1617
import logging
1718
import warnings
1819
from typing import Iterable

dev_tools/qualtran_dev_tools/notebook_execution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def __call__(self, nb_rel_path: Path, sourceroot: Path) -> _NotebookRunResult:
215215
start = time.time()
216216
err = execute_and_export_notebook(paths)
217217
end = time.time()
218-
print(f"Exported {nb_rel_path} in {end-start:.2f} seconds.")
218+
print(f"Exported {nb_rel_path} in {end - start:.2f} seconds.")
219219
return _NotebookRunResult(paths.nb_in, err, duration_s=end - start)
220220

221221

dev_tools/qualtran_dev_tools/shell_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ def run(
9191
if abbreviate_non_option_arguments:
9292
cmd_desc = abbreviate_command_arguments_after_switches(cmd_desc)
9393
print("run:", cmd_desc, file=sys.stderr)
94-
return subprocess.run( # noqa: PLW1510
94+
return subprocess.run( # pylint: disable=subprocess-run-check # noqa: PLW1510
9595
args, **subprocess_run_kwargs
96-
) # pylint: disable=subprocess-run-check
96+
)
9797

9898

9999
def output_of(args: Union[str, List[str]], **kwargs) -> str:

qualtran/_infra/bloq.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,8 @@ def on(self, *qubits: 'cirq.Qid') -> 'cirq.Operation':
633633
return cirq.Gate.on(BloqAsCirqGate(bloq=self), *qubits)
634634

635635
def on_registers(
636-
self, **qubit_regs: Union['cirq.Qid', Sequence['cirq.Qid'], 'NDArray[cirq.Qid]'] # type: ignore[type-var]
636+
self,
637+
**qubit_regs: Union['cirq.Qid', Sequence['cirq.Qid'], 'NDArray[cirq.Qid]'], # type: ignore[type-var]
637638
) -> 'cirq.Operation':
638639
"""A `cirq.Operation` of this bloq operating on the given qubit registers.
639640

qualtran/_infra/composite_bloq.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Classes for building and manipulating `CompositeBloq`."""
16+
1617
from collections.abc import Hashable
1718
from functools import cached_property
1819
from typing import (

qualtran/_infra/composite_bloq_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,10 @@ def signature(self) -> Signature:
338338
return Signature([Register('control', QBit()), Register('target', QBit(), shape=(2, 3))])
339339

340340
def build_composite_bloq(
341-
self, bb: 'BloqBuilder', control: 'Soquet', target: NDArray['Soquet'] # type: ignore[type-var]
341+
self,
342+
bb: 'BloqBuilder',
343+
control: 'Soquet',
344+
target: NDArray['Soquet'], # type: ignore[type-var]
342345
) -> Dict[str, SoquetT]:
343346
for i in range(2):
344347
for j in range(3):

qualtran/_infra/data_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414
"""Quantum data type definitions."""
1515

16-
1716
import abc
1817
import itertools
1918
import warnings
@@ -812,7 +811,7 @@ def __attrs_post_init__(self):
812811
if self.bound > 2**self.bitsize:
813812
raise ValueError(
814813
f"{self} bound is too large for given bitsize. "
815-
f"{self.bound} vs {2 ** self.bitsize}"
814+
f"{self.bound} vs {2**self.bitsize}"
816815
)
817816

818817
@bound.default

qualtran/_infra/gate_with_registers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ def _num_qubits_(self) -> int:
327327
return total_bits(self.signature)
328328

329329
def decompose_from_registers(
330-
self, *, context: 'cirq.DecompositionContext', **quregs: NDArray['cirq.Qid'] # type: ignore[type-var]
330+
self,
331+
*,
332+
context: 'cirq.DecompositionContext',
333+
**quregs: NDArray['cirq.Qid'], # type: ignore[type-var]
331334
) -> 'cirq.OP_TREE':
332335
raise DecomposeNotImplementedError(f"{self} does not declare a decomposition.")
333336

@@ -361,7 +364,8 @@ def on(self, *qubits) -> 'cirq.Operation':
361364
return cirq.Gate.on(self, *qubits)
362365

363366
def on_registers(
364-
self, **qubit_regs: Union['cirq.Qid', Sequence['cirq.Qid'], NDArray['cirq.Qid']] # type: ignore[type-var]
367+
self,
368+
**qubit_regs: Union['cirq.Qid', Sequence['cirq.Qid'], NDArray['cirq.Qid']], # type: ignore[type-var]
365369
) -> 'cirq.Operation':
366370
return self.on(*merge_qubits(self.signature, **qubit_regs))
367371

qualtran/_infra/quantum_graph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Plumbing for bloq-to-bloq `Connection`s."""
16+
1617
from functools import cached_property
1718
from typing import Tuple, TYPE_CHECKING, Union
1819

qualtran/_infra/registers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Classes for specifying `Bloq.registers`."""
16+
1617
import enum
1718
import itertools
1819
from collections import defaultdict

0 commit comments

Comments
 (0)