Skip to content

Commit 181c6c8

Browse files
committed
style: ruff format test_error_messages + test_measurement_error_time_edges
1 parent 641d9de commit 181c6c8

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

python/tests/test_error_messages.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
they mention "unknown", the offending kind, and (for the benchmark dispatcher)
55
the list of valid choices.
66
"""
7+
78
import numpy as np
89
import pytest
910

1011
from qector_decoder_v3 import codes, dem, result, benchmarking
1112

1213

1314
def _small_dem():
14-
text = (
15-
"error(0.1) D0 L0\n"
16-
"error(0.1) D0 D1\n"
17-
"error(0.1) D1 L0\n"
18-
)
15+
text = "error(0.1) D0 L0\nerror(0.1) D0 D1\nerror(0.1) D1 L0\n"
1916
return dem.parse_dem(text)
2017

2118

@@ -45,6 +42,4 @@ def test_benchmark_decoder_message_lists_choices():
4542
msg = str(excinfo.value)
4643
assert "zzz" in msg
4744
# message enumerates valid decoder kinds
48-
assert "blossom" in msg and "union_find" in msg, (
49-
f"message should list valid choices: {msg!r}"
50-
)
45+
assert "blossom" in msg and "union_find" in msg, f"message should list valid choices: {msg!r}"

python/tests/test_measurement_error_time_edges.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* QECTOR's logical error rate is within a Wilson-CI slack of upstream PyMatching
1111
on the SAME shots — i.e. the time edges are wired up correctly.
1212
"""
13+
1314
import math
1415

1516
import numpy as np
@@ -47,9 +48,7 @@ def test_measurement_error_time_edges_match_pymatching(d):
4748
sdem = circ.detector_error_model(decompose_errors=True)
4849
assert sdem.num_observables >= 1
4950

50-
det, obs = circ.compile_detector_sampler(seed=2025).sample(
51-
shots=N, separate_observables=True
52-
)
51+
det, obs = circ.compile_detector_sampler(seed=2025).sample(shots=N, separate_observables=True)
5352
det = det.astype(np.uint8)
5453
obs = obs.astype(np.uint8)
5554
assert det.shape == (N, sdem.num_detectors)

0 commit comments

Comments
 (0)