Skip to content

Commit 38c7d16

Browse files
ruff fix with new linters
1 parent 9ea27c5 commit 38c7d16

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

graphix/pretty_print.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import dataclasses
66
import enum
77
import math
8+
import string
89
from dataclasses import MISSING
910
from enum import Enum
1011
from fractions import Fraction
@@ -91,8 +92,8 @@ def domain_to_str(domain: set[Node]) -> str:
9192
return f"{{{','.join(str(node) for node in domain)}}}"
9293

9394

94-
SUBSCRIPTS = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉")
95-
SUPERSCRIPTS = str.maketrans("0123456789", "⁰¹²³⁴⁵⁶⁷⁸⁹")
95+
SUBSCRIPTS = str.maketrans(string.digits, "₀₁₂₃₄₅₆₇₈₉")
96+
SUPERSCRIPTS = str.maketrans(string.digits, "⁰¹²³⁴⁵⁶⁷⁸⁹")
9697

9798

9899
def command_to_str(cmd: command.Command, output: OutputFormat) -> str:

tests/test_pretty_print.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,4 @@ def test_pattern_pretty_print_example() -> None:
8484
def test_pattern_pretty_print_random(fx_bg: PCG64, jumps: int, output: OutputFormat) -> None:
8585
rng = Generator(fx_bg.jumped(jumps))
8686
rand_pat = rand_circuit(5, 5, rng=rng).transpile().pattern
87-
try:
88-
pattern_to_str(rand_pat, output)
89-
except Exception as e:
90-
pytest.fail(str(e))
87+
pattern_to_str(rand_pat, output)

0 commit comments

Comments
 (0)