Gurobi / modeling-examples

Gurobi modeling examples
https://gurobi.github.io/modeling-examples/
Apache License 2.0
613 stars 269 forks source link

Lack of control in Google Colab environment #30

Open venaturum opened 4 months ago

venaturum commented 4 months ago

Some notebooks have been broken recently by changes in packages, eg

gurobipy 10 -> gurobipy 11 pandas 1 -> pandas 2 gensim not compatible with SciPy 1.13.0

We need to have tight control over the python environment that these notebooks are run under, especially on Google Colab. Unfortunately Colab does not provide a nice way of facilitating this.

I'm proposing we create a public repo modeling-examples-requirements in which we setup a codeless python package with pinned dependencies, essentially creating a lock file in package form. The sole purpose of this package is to tightly control the package versions in an any environment it is installed into. Then in notebooks we only have to have %pip install /path/to/modeling-examples-requirements.git (or something like that).

We could even be fancy and define a separate set of requirements on some different branches to cater for certain notebooks, and avoid having one huge environment. There'd probably be less than 10 different such branches needed.

venaturum commented 4 months ago

Actually creating a package might be overkill. We can use %pip install -r https://url.to.a.requirements.txt.file so we could create e requirements folder which contains pinned dependencies