Fix some mypy issues

This commit is contained in:
2021-04-11 17:07:45 -05:00
parent 16630b3a36
commit 2d4ded1978
2 changed files with 4 additions and 2 deletions

View File

@@ -399,6 +399,8 @@ class BasePyomoSolver(InternalSolver):
return None
def _parse_pyomo_variable(self, var: pyomo.core.Var) -> Variable:
assert self.model is not None
# Variable type
vtype: Optional[str] = None
if var.domain == pyomo.core.Binary:
@@ -472,7 +474,7 @@ class BasePyomoSolver(InternalSolver):
# Build constraint
return constr
def _parse_pyomo_expr(self, expr):
def _parse_pyomo_expr(self, expr: Any) -> Dict[str, float]:
lhs = {}
if isinstance(expr, SumExpression):
for term in expr._args_: