Skip to content

Commit

Permalink
Fix format issues flagged by black
Browse files Browse the repository at this point in the history
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.
```
  • Loading branch information
mhucka committed Feb 23, 2025
1 parent a2bf6e8 commit 878c05e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cirq-core/cirq/ops/op_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/transformers/dynamical_decoupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 878c05e

Please sign in to comment.