Fix linting.

This commit is contained in:
Mikael CAPELLE
2024-12-03 14:11:29 +01:00
parent 5c43eb2c73
commit b32d46b641
49 changed files with 1160 additions and 353 deletions

View File

@@ -0,0 +1,86 @@
from __future__ import annotations
from typing import overload
from docplex.mp.basic import Expr
from docplex.mp.operand import LinearOperand
from docplex.mp.quad import QuadExpr
class AbstractLinearExpr(LinearOperand, Expr): ...
class MonomialExpr(AbstractLinearExpr):
def __sub__(self, e: LinearOperand | float) -> LinearExpr: ...
def __rsub__(self, e: LinearOperand | float) -> LinearExpr: ...
def __neg__(self) -> MonomialExpr: ...
def __add__(self, other: LinearOperand | float) -> LinearExpr: ...
def __radd__(self, other: LinearOperand | float) -> LinearExpr: ...
@overload
def __mul__(self, other: float) -> MonomialExpr: ...
@overload
def __mul__(self, other: LinearExpr) -> QuadExpr: ...
def __rmul__(self, other: float) -> MonomialExpr: ...
def __div__(self, other: float) -> MonomialExpr: ...
def __truediv__(self, e: float) -> MonomialExpr: ...
class LinearExpr(AbstractLinearExpr):
def __sub__(self, e: LinearOperand | float) -> LinearExpr: ...
def __rsub__(self, e: LinearOperand | float) -> LinearExpr: ...
def __neg__(self) -> LinearExpr: ...
def __add__(self, e: LinearOperand | float) -> LinearExpr: ...
def __radd__(self, e: LinearOperand | float) -> LinearExpr: ...
@overload
def __mul__(self, e: float) -> LinearExpr: ...
@overload
def __mul__(self, e: LinearOperand) -> QuadExpr: ...
def __rmul__(self, e: float) -> LinearExpr: ...
def __div__(self, e: float) -> LinearExpr: ...
def __truediv__(self, e: float) -> LinearExpr: ...
class ZeroExpr(AbstractLinearExpr):
@overload
def __sub__(self, e: float) -> ConstantExpr: ...
@overload
def __sub__(self, e: LinearOperand) -> LinearExpr: ...
@overload
def __rsub__(self, e: float) -> ConstantExpr: ...
@overload
def __rsub__(self, e: LinearOperand) -> LinearExpr: ...
@overload
def __add__(self, e: float) -> ConstantExpr: ...
@overload
def __add__(self, e: LinearOperand) -> LinearExpr: ...
@overload
def __radd__(self, e: float) -> ConstantExpr: ...
@overload
def __radd__(self, e: LinearOperand) -> LinearExpr: ...
def __neg__(self) -> ZeroExpr: ...
def __mul__(self, e: float | LinearOperand) -> ZeroExpr: ...
def __rmul__(self, e: float | LinearOperand) -> ZeroExpr: ...
def __div__(self, e: float) -> ZeroExpr: ...
def __truediv__(self, e: float) -> ZeroExpr: ...
class ConstantExpr(AbstractLinearExpr):
@overload
def __sub__(self, e: float) -> ConstantExpr: ...
@overload
def __sub__(self, e: LinearOperand) -> LinearExpr: ...
@overload
def __rsub__(self, e: float) -> ConstantExpr: ...
@overload
def __rsub__(self, e: LinearOperand) -> LinearExpr: ...
@overload
def __add__(self, e: float) -> ConstantExpr: ...
@overload
def __add__(self, e: LinearOperand) -> LinearExpr: ...
@overload
def __radd__(self, e: float) -> ConstantExpr: ...
@overload
def __radd__(self, e: LinearOperand) -> LinearExpr: ...
def __neg__(self) -> ConstantExpr: ...
@overload
def __mul__(self, e: float) -> ConstantExpr: ...
@overload
def __mul__(self, e: LinearOperand) -> LinearExpr: ...
def __rmul__(self, e: float | LinearOperand) -> ConstantExpr: ...
def __div__(self, e: float) -> ConstantExpr: ...
def __truediv__(self, e: float) -> ConstantExpr: ...