BenchmarkRunner.fit: Only iterate through files twice

This commit is contained in:
2021-06-28 09:31:41 -05:00
parent aaef8b8fb3
commit 46a7d3fe26
5 changed files with 36 additions and 28 deletions

View File

@@ -58,7 +58,7 @@ def test_learning_solver(
assert after_lp.lp_solve.lp_log is not None
assert len(after_lp.lp_solve.lp_log) > 100
solver.fit([instance])
solver.fit([instance], n_jobs=4)
solver.solve(instance)
# Assert solver is picklable

View File

@@ -28,7 +28,7 @@ def test_benchmark() -> None:
"Strategy B": LearningSolver(),
}
benchmark = BenchmarkRunner(test_solvers)
benchmark.fit(train_instances) # type: ignore
benchmark.fit(train_instances, n_jobs=n_jobs) # type: ignore
benchmark.parallel_solve(
test_instances, # type: ignore
n_jobs=n_jobs,