d-krupke / cpsat-primer

The CP-SAT Primer: Using and Understanding Google OR-Tools' CP-SAT Solver
https://d-krupke.github.io/cpsat-primer/
Creative Commons Attribution 4.0 International
387 stars 35 forks source link

Snake case conversions across python files #54

Closed greenLeopard closed 3 months ago

greenLeopard commented 3 months ago

This PR updates all of the notebooks and python modules to use snake case #34 I re-ran everything I could to test that it was still working. On Jupyter notebooks, where possible, I updated the code to snake case and saved the code changes, then test ran the notebook without saving the new notebook outputs - this largely prevents the big diffs. Occasionally, I did save all the outputs, and you get the big diffs. Sorry about that.

A couple of obstacles I had when re-running code after changing to snake case:

  1. examples/add_no_overlap_2d_parameters.ipynb - I get an AssertionError (assert status == cp_model.OPTIMAL) with pack() instances that have scale=10_000, so I set scale=1000 and ran the notebook to completion.
  2. evaluations/tsp - I didn't rerun the benchmarks because they rely on a comparison with gurobi, and I don't have access to a gurobi license.
  3. evaluations/embedding_cpsat & evaluations/optimization_api - I only made modest changes to the cp_model function calls, and didn't rerun these.
  4. In examples/add_no_overlap_2d_parameters.py commented out the solve parameter use_pairwise_reasoning_in_no_overlap_2d as it wasn't found.

There are a couple of additional small fixes:

Let me know if you need any adjustments.

d-krupke commented 3 months ago

Looks perfect, accepted! Thank you so much and have a great Sunday :)