Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hinting for pyomo and gurobi models #42

Open
TobyBoyne opened this issue Jul 3, 2024 · 0 comments
Open

Type hinting for pyomo and gurobi models #42

TobyBoyne opened this issue Jul 3, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@TobyBoyne
Copy link
Collaborator

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.

@TobyBoyne TobyBoyne added the enhancement New feature or request label Jul 3, 2024
@TobyBoyne TobyBoyne self-assigned this Jul 3, 2024
@TobyBoyne TobyBoyne added the documentation Improvements or additions to documentation label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant