Closed rluce closed 2 years ago
Pandas always uses snake case for functions (value_counts, is_unique, sort_values, etc, etc). I'd favour snake case if possible, but we can live with the inconsistency with gurobipy?
Some mixing and matching between the accessors and plain gurobipy calls is inevitable. For example this mixture might look a bit odd:
m = Model()
df = data.grb.pd_add_vars(m, ...)
df.grb.pd_add_constrs(m, ...)
m.setObjective(df['y'].sum())
m.setParam('Method', 3)
m.optimize()
On the other hand, mixing styles in method chains looks worse:
df = (
data
.drop_duplicates(...)
.grb.pdAddVars(m, ...)
.sort_values(...)
)
Maybe snake case is better, since it's the accepted python style and matches pandas calls in method chains. It might also help to make the distinction clearer between gurobipy
and gurobipy-pandas
API calls so we avoid confusion between the different method signatures.
OK I think this means: We go for snake_case.
Done with fcf7658...f6e8c25
We use lowerCamelCase (because gurobipy does?), but PEP8 suggests words_with_underscores. What does Pandas do? What should we do here?