From 878c05eeb2ae70db885240004f6a80728f762079 Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Sun, 23 Feb 2025 10:39:12 -0800 Subject: [PATCH] Fix format issues flagged by black MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When I run `check/format-incremental`, it reports two trivial formatting errors as shown below. This commit fixes that. ``` Comparing against revision 'upstream/main'. Running the black formatter... (version: black, 25.1.0 (compiled: yes) Python (CPython) 3.10.14) --- cirq-core/cirq/ops/op_tree.py 2025-01-30 20:52:25.721992+00:00 +++ cirq-core/cirq/ops/op_tree.py 2025-02-23 18:32:17.923984+00:00 @@ -10,12 +10,11 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""A recursive type describing trees of operations, and utility methods for it. -""" +"""A recursive type describing trees of operations, and utility methods for it.""" from typing import Callable, Iterable, Iterator, NoReturn, Union, TYPE_CHECKING from cirq._doc import document from cirq._import import LazyLoader would reformat cirq-core/cirq/ops/op_tree.py --- cirq-core/cirq/transformers/dynamical_decoupling.py 2025-01-30 20:52:25.732467+00:00 +++ cirq-core/cirq/transformers/dynamical_decoupling.py 2025-02-23 18:32:18.291548+00:00 @@ -81,11 +81,11 @@ f' identity up to a global phase, got {product}.'.replace('\n', ' ') ) def _parse_dd_sequence( - schema: Union[str, Tuple[ops.Gate, ...]] + schema: Union[str, Tuple[ops.Gate, ...]], ) -> Tuple[Tuple[ops.Gate, ...], Dict[ops.Gate, ops.Pauli]]: """Parses and returns dynamical decoupling sequence and its associated pauli map from schema.""" dd_sequence = None if isinstance(schema, str): dd_sequence = _get_dd_sequence_from_schema_name(schema) would reformat cirq-core/cirq/transformers/dynamical_decoupling.py Oh no! 💥 💔 💥 2 files would be reformatted, 167 files would be left unchanged. ``` --- cirq-core/cirq/ops/op_tree.py | 3 +-- cirq-core/cirq/transformers/dynamical_decoupling.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cirq-core/cirq/ops/op_tree.py b/cirq-core/cirq/ops/op_tree.py index 0bbe64e2167..56ba6af4073 100644 --- a/cirq-core/cirq/ops/op_tree.py +++ b/cirq-core/cirq/ops/op_tree.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""A recursive type describing trees of operations, and utility methods for it. -""" +"""A recursive type describing trees of operations, and utility methods for it.""" from typing import Callable, Iterable, Iterator, NoReturn, Union, TYPE_CHECKING diff --git a/cirq-core/cirq/transformers/dynamical_decoupling.py b/cirq-core/cirq/transformers/dynamical_decoupling.py index 0a8f6365bbf..804056a8e59 100644 --- a/cirq-core/cirq/transformers/dynamical_decoupling.py +++ b/cirq-core/cirq/transformers/dynamical_decoupling.py @@ -83,7 +83,7 @@ def _validate_dd_sequence(dd_sequence: Tuple[ops.Gate, ...]) -> None: def _parse_dd_sequence( - schema: Union[str, Tuple[ops.Gate, ...]] + schema: Union[str, Tuple[ops.Gate, ...]], ) -> Tuple[Tuple[ops.Gate, ...], Dict[ops.Gate, ops.Pauli]]: """Parses and returns dynamical decoupling sequence and its associated pauli map from schema.""" dd_sequence = None