Skip to content

Commit

Permalink
🎨 pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Apr 19, 2024
1 parent d00af11 commit e258703
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/mqt/bench/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from __future__ import annotations

Check warning on line 1 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L1

Added line #L1 was not covered by tests

import argparse

Check warning on line 3 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L3

Added line #L3 was not covered by tests

from mqt.bench import QiskitSettings, TKETSettings, get_benchmark, CompilerSettings
from pytket import Circuit
from pytket.qasm import circuit_to_qasm_str
from qiskit import QuantumCircuit
from qiskit.qasm2 import dumps as qiskit_circuit_to_str

Check warning on line 8 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L5-L8

Added lines #L5 - L8 were not covered by tests

from mqt.bench import CompilerSettings, QiskitSettings, TKETSettings, get_benchmark

Check warning on line 10 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L10

Added line #L10 was not covered by tests


def main() -> None:

Check warning on line 13 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L13

Added line #L13 was not covered by tests
"""
Expand All @@ -16,9 +19,12 @@ def main() -> None:
"""

parser = argparse.ArgumentParser(description="Generate a single benchmark")
parser.add_argument("--level", type=str,
help='Level to generate benchmarks for ("alg", "indep", "nativegates" or "mapped")',
required=True)
parser.add_argument(

Check warning on line 22 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L21-L22

Added lines #L21 - L22 were not covered by tests
"--level",
type=str,
help='Level to generate benchmarks for ("alg", "indep", "nativegates" or "mapped")',
required=True,
)
parser.add_argument("--algorithm", type=str, help="Name of the benchmark", required=True)
parser.add_argument("--num-qubits", type=int, help="Number of Qubits")
parser.add_argument("--compiler", type=str, help="Name of the compiler")
Expand Down Expand Up @@ -56,6 +62,7 @@ def main() -> None:
elif isinstance(result, Circuit):
qasm_str = circuit_to_qasm_str(result)

Check warning on line 63 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L60-L63

Added lines #L60 - L63 were not covered by tests
else:
raise TypeError(f"Got unknown circuit type from get_benchmark: {type(result)}")
msg = f"Got unknown circuit type from get_benchmark: {type(result)}"
raise TypeError(msg)

Check warning on line 66 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L65-L66

Added lines #L65 - L66 were not covered by tests

print(qasm_str)

Check warning on line 68 in src/mqt/bench/cli.py

View check run for this annotation

Codecov / codecov/patch

src/mqt/bench/cli.py#L68

Added line #L68 was not covered by tests

0 comments on commit e258703

Please sign in to comment.