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

gurobipy_pandas methods are not exported for pyright type checker #73

Closed Dr-Irv closed 4 months ago

Dr-Irv commented 4 months ago

See the pic of using pylance/pyright in VS Code: image

In gurobipy_pandas/__init__.py, if I change to this line:

from gurobipy_pandas.api import add_vars as add_vars # noqa: F401

Then the error goes away.

simonbowly commented 4 months ago

I can't reproduce the issue in my vscode or running pyright manually (pyright 1.1.363) but would prefer to fix it by defining:

__all__ = ["add_vars", "add_constrs", "set_interactive"]

as the redundancy seems really odd to me. According to pyright's docs this should also do the trick.

simonbowly commented 4 months ago

This fix is released with version 1.1.2