From 91fe48478d609deaace1dffc90aa6326cdba913b Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 26 Mar 2024 12:33:42 +0100 Subject: [PATCH] reformat --- ortools/init/python/init_test.py | 1 + ortools/sat/docs/channeling.md | 7 +++---- ortools/sat/samples/index_first_boolvar_true_sample_sat.py | 7 +++---- ortools/util/python/sorted_interval_list_test.py | 1 + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ortools/init/python/init_test.py b/ortools/init/python/init_test.py index 62060a96a1..7eb2402a91 100755 --- a/ortools/init/python/init_test.py +++ b/ortools/init/python/init_test.py @@ -19,6 +19,7 @@ from ortools.init.python import init class InitTest(absltest.TestCase): + def test_logging(self): print("test_logging") init.CppBridge.init_logging("pywrapinit_test.py") diff --git a/ortools/sat/docs/channeling.md b/ortools/sat/docs/channeling.md index e29c647a8d..3b99d3e6f0 100644 --- a/ortools/sat/docs/channeling.md +++ b/ortools/sat/docs/channeling.md @@ -416,7 +416,7 @@ class VarArraySolutionPrinter(cp_model.CpSolverSolutionCallback): print(line) -def index_first_solution_true_sample_sat(): +def index_of_first_bool_at_true_sample_sat(): """Compute the index of the first Boolean variable set to true.""" # Model. @@ -446,15 +446,14 @@ def index_first_solution_true_sample_sat(): # Force the solver to follow the decision strategy exactly. solver.parameters.search_branching = cp_model.FIXED_SEARCH - # Enumerate all solutions. - solver.parameters.enumerate_all_solutions = True # Search and print out all solutions. + solver.parameters.enumerate_all_solutions = True solution_printer = VarArraySolutionPrinter(index, bool_vars) solver.solve(model, solution_printer) -index_first_solution_true_sample_sat() +index_of_first_bool_at_true_sample_sat() ``` This displays the following: diff --git a/ortools/sat/samples/index_first_boolvar_true_sample_sat.py b/ortools/sat/samples/index_first_boolvar_true_sample_sat.py index 7d70de0528..e93b776fbb 100644 --- a/ortools/sat/samples/index_first_boolvar_true_sample_sat.py +++ b/ortools/sat/samples/index_first_boolvar_true_sample_sat.py @@ -33,7 +33,7 @@ class VarArraySolutionPrinter(cp_model.CpSolverSolutionCallback): print(line) -def index_first_solution_true_sample_sat(): +def index_of_first_bool_at_true_sample_sat(): """Compute the index of the first Boolean variable set to true.""" # Model. @@ -63,12 +63,11 @@ def index_first_solution_true_sample_sat(): # Force the solver to follow the decision strategy exactly. solver.parameters.search_branching = cp_model.FIXED_SEARCH - # Enumerate all solutions. - solver.parameters.enumerate_all_solutions = True # Search and print out all solutions. + solver.parameters.enumerate_all_solutions = True solution_printer = VarArraySolutionPrinter(index, bool_vars) solver.solve(model, solution_printer) -index_first_solution_true_sample_sat() +index_of_first_bool_at_true_sample_sat() diff --git a/ortools/util/python/sorted_interval_list_test.py b/ortools/util/python/sorted_interval_list_test.py index 99f2887f61..b33eb7d878 100755 --- a/ortools/util/python/sorted_interval_list_test.py +++ b/ortools/util/python/sorted_interval_list_test.py @@ -19,6 +19,7 @@ from ortools.util.python import sorted_interval_list class SortedIntervalListTest(absltest.TestCase): + def testCtorAndGetter(self): bool_domain = sorted_interval_list.Domain(0, 1) self.assertEqual(2, bool_domain.size())