Gurobi / gurobipy-pandas

Convenience wrapper for building optimization models from pandas data
https://gurobipy-pandas.readthedocs.io/en/stable/
Apache License 2.0
83 stars 15 forks source link

Automatically clean up variable and constraint names #44

Closed simonbowly closed 1 year ago

simonbowly commented 1 year ago

As discussed in #36, pd_add_vars and pd_add_constrs should clean up any names they create which are incompatible with LP/MPS formats. This can easily happen when creating series variables from string or datetime indexes.

We should also consider truncating long generated names to fit the length restrictions of gurobipy.

simonbowly commented 1 year ago

Done via #34. Indexes are formatter up by a default index mapper before being used to construct names.

Note that we will not fix the case where the user passes a name= argument containing illegal characters for LP format, but I'd consider that a user error, and it's easily fixed on the user side. They'll get a warning from gurobipy when writing a file and it should be easy to figure out.

Details in docs/source/naming.rst