Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#388)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.8.1](astral-sh/ruff-pre-commit@v0.7.2...v0.8.1)

* fix: formatting in benchmark files

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabian <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and FabianHofmann authored Dec 5, 2024
1 parent d70472c commit 37d720b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: trailing-whitespace
- id: check-merge-conflict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.8.1
hooks:
- id: ruff
args: [--fix]
Expand Down
6 changes: 3 additions & 3 deletions benchmark/scripts/benchmark_ortools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def model(n, solver):
y = {}
for i in range(n):
for j in range(n):
x[i, j] = solver.NumVar(lb=None, ub=None, name="x_%d_%d" % (i, j))
y[i, j] = solver.NumVar(lb=None, ub=None, name="y_%d_%d" % (i, j))
x[i, j] = solver.NumVar(lb=None, ub=None, name=f"x_{i}_{j}")
y[i, j] = solver.NumVar(lb=None, ub=None, name=f"y_{i}_{j}")

# Create constraints
for i in range(n):
Expand Down Expand Up @@ -44,7 +44,7 @@ def knapsack_model(n, solver):
weight = rng.integers(1, 100, size=n)
value = rng.integers(1, 100, size=n)

x = {i: solver.BoolVar("x_%d" % i) for i in range(n)}
x = {i: solver.BoolVar(f"x_{i}") for i in range(n)}
# Create constraints
solver.Add(solver.Sum([weight[i] * x[i] for i in range(n)]) <= 200)

Expand Down

0 comments on commit 37d720b

Please sign in to comment.