Closed simonbowly closed 1 year ago
We should do this for the accessors via __getattr__
to pick up accidental camel case use and throw a nice error
Done for the series accessor. Users will get did you mean set_attr
instead of 'gurobipy.Var' object has no attribute 'setAttr'
to direct them towards snake case for the accessor.
For the dataframe accessor, addVars/addConstrs already throws a reasonable attribute error.
gurobipy natives might run into some confusion with
model.addVars
andgppd.add_vars
. For the global functions, python3.10 has a nice feature to help:But this may not catch all cases (especially in accessors where we just call down to find a gurobipy object method) and won't help for py39 and earlier. For common cases (e.g.
setAttr
on a series accessor, where we will useset_attr
), we can consider throwing the above error ourselves to help guide users.