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 Nov 26, 2024
1 parent 09980d4 commit 323a06d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions tests/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
assert len(solution) <= len(graph.nodes), "Solution set should not exceed the number of nodes in the graph"
2 changes: 0 additions & 2 deletions tests/test_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


1 change: 0 additions & 1 deletion tests/test_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 323a06d

Please sign in to comment.