Type hinting for pyomo and gurobi models
Opened this issue · 0 comments
TobyBoyne commented
Currently, many key attributes (such as model._all_feat
) are used throughout the codebase, but are not type hinted and are poorly documented. I propose creating subclasses of pyo.Model
and gurobi.Model
that have type hints (only to be used for type stubs, not functional). This would then be a natural place for the associated documentation as well.
An example of where this is important is in user-defined constraints. Users are expected to use model._all_feat
to access the relevant variables, but we do not provide a user-friendly interface to do so. I will also note here that the underscore implies this is a private attribute, but we ask users to access it publicly.