Skip to content

Commit

Permalink
⬆️🪝 update pre-commit hooks (#20)
Browse files Browse the repository at this point in the history
* ⬆️🪝 update pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.5.4](astral-sh/ruff-pre-commit@v0.5.2...v0.5.4)
- [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.0](pre-commit/mirrors-mypy@v1.10.1...v1.11.0)

* 🎨 pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jul 22, 2024
1 parent 244a029 commit 0cd3424
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ repos:

# Python linting using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.2
rev: v0.5.4
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -68,7 +68,7 @@ repos:

# Static type checking using mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.0
hooks:
- id: mypy
files: ^(src/mqt|tests)
Expand Down
12 changes: 4 additions & 8 deletions tests/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,7 @@ def test_simulated_annealer_solver_constrained(lambda_strategy: str, constraint_
assert solution.optimal_solution_cost_functions_values() == {"a + b*c + c**2": -0.25} or not all_satisfy
elif constraint_expr == "b <= 1":
assert (
solution.best_solution == {"a": 0.0, "b": 1.0, "c": -0.5}
or solution.best_solution == {"a": 0.0, "b": -1.0, "c": 0.5}
solution.best_solution in ({"a": 0.0, "b": 1.0, "c": -0.5}, {"a": 0.0, "b": -1.0, "c": 0.5})
or not all_satisfy
)
assert (
Expand Down Expand Up @@ -1178,8 +1177,7 @@ def test_simulated_annealer_solver_constrained_lambda_update_mechanism(
assert solution.optimal_solution_cost_functions_values() == {"a + b*c + c**2": -0.25} or not all_satisfy
elif constraint_expr == "b <= 1":
assert (
solution.best_solution == {"a": 0.0, "b": 1.0, "c": -0.5}
or solution.best_solution == {"a": 0.0, "b": -1.0, "c": 0.5}
solution.best_solution in ({"a": 0.0, "b": 1.0, "c": -0.5}, {"a": 0.0, "b": -1.0, "c": 0.5})
or not all_satisfy
)
assert (
Expand Down Expand Up @@ -1380,8 +1378,7 @@ def test_simulated_annealer_solver_constrained_lambda_update_mechanism_and_strat
assert solution.optimal_solution_cost_functions_values() == {"a + b*c + c**2": -0.25} or not all_satisfy
elif constraint_expr == "b <= 1":
assert (
solution.best_solution == {"a": 0.0, "b": 1.0, "c": -0.5}
or solution.best_solution == {"a": 0.0, "b": -1.0, "c": 0.5}
solution.best_solution in ({"a": 0.0, "b": 1.0, "c": -0.5}, {"a": 0.0, "b": -1.0, "c": 0.5})
or not all_satisfy
)
assert (
Expand Down Expand Up @@ -1455,8 +1452,7 @@ def test_simulated_annealing_cost_function_matrix(
all_satisfy, _each_satisfy = solution.check_constraint_optimal_solution()
if constraint_expr == "M1_0_1 >= 1":
assert (
solution.best_solution == {"M1": [[-1, 2]], "M2": [[2], [-1]]}
or solution.best_solution == {"M1": [[2, 2]], "M2": [[-1], [-1]]}
solution.best_solution in ({"M1": [[-1, 2]], "M2": [[2], [-1]]}, {"M1": [[2, 2]], "M2": [[-1], [-1]]})
or not all_satisfy
)
assert (solution.best_energy < -3.9) or not all_satisfy
Expand Down

0 comments on commit 0cd3424

Please sign in to comment.