Skip to content

Commit 1ff89c1

Browse files
committed
examples: regenerate notebooks
1 parent d39ce32 commit 1ff89c1

File tree

86 files changed

+1936
-908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1936
-908
lines changed

examples/notebook/algorithms/knapsack.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"from ortools.algorithms.python import knapsack_solver\n",
8787
"\n",
8888
"\n",
89+
"\n",
8990
"def main():\n",
9091
" # Create the solver.\n",
9192
" solver = knapsack_solver.KnapsackSolver(\n",

examples/notebook/algorithms/simple_knapsack_program.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"from ortools.algorithms.python import knapsack_solver\n",
8787
"\n",
8888
"\n",
89+
"\n",
8990
"def main():\n",
9091
" # Create the solver.\n",
9192
" solver = knapsack_solver.KnapsackSolver(\n",

examples/notebook/constraint_solver/cp_is_fun_cp.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"from ortools.constraint_solver import pywrapcp\n",
9292
"\n",
9393
"\n",
94+
"\n",
9495
"def main():\n",
9596
" # Constraint programming engine\n",
9697
" solver = pywrapcp.Solver(\"CP is fun!\")\n",

examples/notebook/constraint_solver/nqueens_cp.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"from ortools.constraint_solver import pywrapcp\n",
8888
"\n",
8989
"\n",
90+
"\n",
9091
"def main(board_size):\n",
9192
" # Creates the solver.\n",
9293
" solver = pywrapcp.Solver(\"n-queens\")\n",

examples/notebook/constraint_solver/simple_cp_program.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"from ortools.constraint_solver import pywrapcp\n",
8787
"\n",
8888
"\n",
89+
"\n",
8990
"def main():\n",
9091
" \"\"\"Entry point of the program.\"\"\"\n",
9192
" # Instantiate the solver.\n",

examples/notebook/contrib/permutation_flow_shop.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
"import numpy as np\n",
9696
"\n",
9797
"from ortools.sat.colab import flags\n",
98-
"from google.protobuf import text_format\n",
9998
"from ortools.sat.python import cp_model\n",
10099
"\n",
101100
"_PARAMS = flags.define_string(\n",
@@ -217,7 +216,7 @@
217216
"\n",
218217
" solver = cp_model.CpSolver()\n",
219218
" if params:\n",
220-
" text_format.Parse(params, solver.parameters)\n",
219+
" solver.parameters.parse_text_format(params)\n",
221220
" solver.parameters.log_search_progress = log\n",
222221
" solver.parameters.max_time_in_seconds = time_limit\n",
223222
"\n",

examples/notebook/contrib/scheduling_with_transitions_sat.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
"import collections\n",
9191
"\n",
9292
"from ortools.sat.python import cp_model\n",
93-
"from google.protobuf import text_format\n",
9493
"\n",
9594
"#----------------------------------------------------------------------------\n",
9695
"# Command line arguments.\n",
@@ -376,7 +375,7 @@
376375
" solver = cp_model.CpSolver()\n",
377376
" solver.parameters.max_time_in_seconds = 60 * 60 * 2\n",
378377
" if parameters:\n",
379-
" text_format.Merge(parameters, solver.parameters)\n",
378+
" solver.parameters.merge_text_format(parameters)\n",
380379
" solution_printer = SolutionPrinter(makespan)\n",
381380
" status = solver.Solve(model, solution_printer)\n",
382381
"\n",

examples/notebook/examples/appointments.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
"\n",
245245
"\n",
246246
"def get_optimal_schedule(\n",
247-
" demand: list[tuple[float, str, int]]\n",
247+
" demand: list[tuple[float, str, int]],\n",
248248
") -> list[tuple[int, list[tuple[int, str]]]]:\n",
249249
" \"\"\"Computes the optimal schedule for the installation input.\n",
250250
"\n",

examples/notebook/examples/arc_flow_cutting_stock_sat.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
"from ortools.sat.colab import flags\n",
9090
"import numpy as np\n",
9191
"\n",
92-
"from google.protobuf import text_format\n",
9392
"from ortools.linear_solver.python import model_builder as mb\n",
9493
"from ortools.sat.python import cp_model\n",
9594
"\n",
@@ -387,7 +386,7 @@
387386
" # Solve model.\n",
388387
" solver = cp_model.CpSolver()\n",
389388
" if params:\n",
390-
" text_format.Parse(params, solver.parameters)\n",
389+
" solver.parameters.parse_text_format(params)\n",
391390
" solver.parameters.log_search_progress = True\n",
392391
" solver.Solve(model)\n",
393392
"\n",

examples/notebook/examples/balance_group_sat.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
"Each item has a color and a value. We want the sum of values of each group to\n",
7979
"be as close to the average as possible.\n",
8080
"Furthermore, if one color is an a group, at least k items with this color must\n",
81-
"be in that group.\n"
81+
"be in that group.\n",
82+
"\n"
8283
]
8384
},
8485
{

0 commit comments

Comments
 (0)