Gurobi / gurobipy-pandas

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

Most arguments should be keyword-only #45

Closed simonbowly closed 1 year ago

simonbowly commented 2 years ago

Especially with pd_add_constrs, positional arguments lb, ub, vtype, name get unwieldy. There is less chance for confusion if we make these keyword only. So we will go with:

accessor.pd_add_vars(model, *, lb, ub, vtype, name=None)
accessor.pd_add_constrs(model, lhs, sense, rhs, *, name)

i.e. attributes must be specified by keyword, the model is always the first positional argument, and essential arguments for constraints are left -> right positional.

simonbowly commented 1 year ago

Done. Attribute and name arguments are keyword-only for:

name is keyword only (lhs, sense, rhs positional) for: