From 323a06dee6c1a117f5d8c0dcda34361217f7555e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:14:56 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20pre-commit=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_evaluation.py | 5 ++--- tests/test_graph.py | 2 +- tests/test_number.py | 2 -- tests/test_set.py | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/test_evaluation.py b/tests/test_evaluation.py index d765fd8..ccc809b 100644 --- a/tests/test_evaluation.py +++ b/tests/test_evaluation.py @@ -3,9 +3,8 @@ from __future__ import annotations from pathlib import Path -from typing import Any, cast +from typing import cast -import networkx as nx import numpy as np import pytest @@ -14,7 +13,6 @@ from sympy import Expr from mqt.qao.constraints import Constraints -from mqt.qao.karp import KarpGraphs, KarpNumber, KarpSets from mqt.qao.objectivefunction import ObjectiveFunction from mqt.qao.problem import Problem from mqt.qao.solvers import Solution, Solver @@ -32,6 +30,7 @@ def test_binary_only() -> None: print(post_dict) assert post_dict == {"a": (boolean_var("b0"),), "A_0": (boolean_var("b1"),), "A_1": (boolean_var("b2"),)} + def test_spin_only() -> None: """Test only the construction of spin variables""" constraint = Constraints() diff --git a/tests/test_graph.py b/tests/test_graph.py index 7c5f0eb..061a17d 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -825,4 +825,4 @@ def test_max_cut_simple_graph(): solution = KarpGraphs.max_cut(graph, solve=True) assert isinstance(solution, list), "Expected a list as the solution" - assert len(solution) <= len(graph.nodes), "Solution set should not exceed the number of nodes in the graph" \ No newline at end of file + assert len(solution) <= len(graph.nodes), "Solution set should not exceed the number of nodes in the graph" diff --git a/tests/test_number.py b/tests/test_number.py index 212db23..f37a072 100644 --- a/tests/test_number.py +++ b/tests/test_number.py @@ -268,5 +268,3 @@ def test_knapsack_with_large_max_weight(): assert total_weight <= max_weight, "Total weight should not exceed the maximum allowed weight" assert total_value <= 20, "Expected total value to be the sum of all item values" - - \ No newline at end of file diff --git a/tests/test_set.py b/tests/test_set.py index 89edd9a..01398d8 100644 --- a/tests/test_set.py +++ b/tests/test_set.py @@ -248,4 +248,3 @@ def test_hitting_set_empty_input(): input_data: list[Any] = [] problem = KarpSets.hitting_set(input_data, solve=False) assert isinstance(problem, Problem), "Expected a Problem instance even with empty input" -