diff --git a/docs/source/conf.py b/docs/source/conf.py index d4a72b27..a4a5a27c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -109,7 +109,7 @@ class CDAStyle(UnsrtStyle): """Custom style for including PDF links.""" - def format_url(self, _e: Entry) -> HRef: + def format_url(self, _e: Entry) -> HRef: # noqa: PLR6301 """Format URL field as a link to the PDF.""" url = field("url", raw=True) return href()[url, "[PDF]"] diff --git a/pyproject.toml b/pyproject.toml index 34558334..fe8de779 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -210,7 +210,7 @@ extend-select = [ "SIM", # flake8-simplify "T20", # flake8-print "TCH", # flake8-type-checking - "TID251", # flake8-tidy-imports.banned-api + "TID", # flake8-tidy-imports "TRY", # tryceratops "UP", # pyupgrade "YTT", # flake8-2020 diff --git a/src/mqt/qcec/compilation_flow_profiles.py b/src/mqt/qcec/compilation_flow_profiles.py index 3e3d421b..fb80fadc 100644 --- a/src/mqt/qcec/compilation_flow_profiles.py +++ b/src/mqt/qcec/compilation_flow_profiles.py @@ -413,4 +413,3 @@ def generate_profile( filename = generate_profile_name(optimization_level=optimization_level, mode=mode) filepath = filepath.joinpath(filename) write_profile_data_to_file(profile, filepath) - print(f"Wrote profile data to {filepath}") diff --git a/test/python/test_compilation_flow_profiles.py b/test/python/test_compilation_flow_profiles.py index 7b110202..9490cd6e 100644 --- a/test/python/test_compilation_flow_profiles.py +++ b/test/python/test_compilation_flow_profiles.py @@ -21,13 +21,13 @@ @pytest.fixture(params=[0, 1, 2, 3]) -def optimization_level(request: Any) -> int: # noqa: ANN401 +def optimization_level(request: Any) -> int: """Fixture for optimization levels.""" return cast(int, request.param) @pytest.fixture(params=[qcec.AncillaMode.NO_ANCILLA, qcec.AncillaMode.RECURSION, qcec.AncillaMode.V_CHAIN]) -def ancilla_mode(request: Any) -> qcec.AncillaMode: # noqa: ANN401 +def ancilla_mode(request: Any) -> qcec.AncillaMode: """Fixture for ancilla modes.""" return cast(qcec.AncillaMode, request.param) diff --git a/test/python/test_symbolic.py b/test/python/test_symbolic.py index 08ee74ed..c927ed90 100644 --- a/test/python/test_symbolic.py +++ b/test/python/test_symbolic.py @@ -188,10 +188,10 @@ def test_verify_compilation_on_optimization_levels(original_circuit: QuantumCirc """Test the verification of the compilation of a circuit to the 5-qubit IBMQ Athens architecture with various optimization levels.""" compiled_circuit = transpile(original_circuit, backend=FakeAthens(), optimization_level=optimization_level) result = qcec.verify_compilation(original_circuit, compiled_circuit, optimization_level, timeout=3600) - assert ( - result.equivalence == qcec.EquivalenceCriterion.equivalent - or result.equivalence == qcec.EquivalenceCriterion.equivalent_up_to_global_phase - ) + assert result.equivalence in { + qcec.EquivalenceCriterion.equivalent, + qcec.EquivalenceCriterion.equivalent_up_to_global_phase, + } @pytest.mark.parametrize("optimization_level", [0, 1, 2, 3]) @@ -205,10 +205,10 @@ def test_verify_compilation_on_optimization_levels_config( result = qcec.verify_compilation( original_circuit, compiled_circuit, optimization_level, AncillaMode.NO_ANCILLA, config ) - assert ( - result.equivalence == qcec.EquivalenceCriterion.equivalent - or result.equivalence == qcec.EquivalenceCriterion.equivalent_up_to_global_phase - ) + assert result.equivalence in { + qcec.EquivalenceCriterion.equivalent, + qcec.EquivalenceCriterion.equivalent_up_to_global_phase, + } def test_performed_instantiations(rz_commute_lhs: QuantumCircuit, rz_commute_rhs_incorrect: QuantumCircuit) -> None: diff --git a/test/python/test_verify_compilation.py b/test/python/test_verify_compilation.py index 14ab8310..5a65bf09 100644 --- a/test/python/test_verify_compilation.py +++ b/test/python/test_verify_compilation.py @@ -25,10 +25,10 @@ def test_verify_compilation_on_optimization_levels(original_circuit: QuantumCirc """Test the verification of the compilation of a circuit to the 5-qubit IBMQ Athens architecture with various optimization levels.""" compiled_circuit = transpile(original_circuit, backend=FakeAthens(), optimization_level=optimization_level) result = qcec.verify_compilation(original_circuit, compiled_circuit, optimization_level=optimization_level) - assert ( - result.equivalence == qcec.EquivalenceCriterion.equivalent - or result.equivalence == qcec.EquivalenceCriterion.equivalent_up_to_global_phase - ) + assert result.equivalence in { + qcec.EquivalenceCriterion.equivalent, + qcec.EquivalenceCriterion.equivalent_up_to_global_phase, + } def test_warning_on_missing_measurements() -> None: