Fix linting.
This commit is contained in:
0
typings/docplex/__init__.pyi
Normal file
0
typings/docplex/__init__.pyi
Normal file
0
typings/docplex/mp/__init__.pyi
Normal file
0
typings/docplex/mp/__init__.pyi
Normal file
8
typings/docplex/mp/basic.pyi
Normal file
8
typings/docplex/mp/basic.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from docplex.mp.operand import Operand
|
||||
|
||||
class Expr(Operand):
|
||||
def __pow__(self, power: Literal[0, 1, 2]) -> Expr: ...
|
25
typings/docplex/mp/constants.pyi
Normal file
25
typings/docplex/mp/constants.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
|
||||
class ObjectiveSense(Enum):
|
||||
Minimize = ...
|
||||
Maximize = ...
|
||||
|
||||
class EffortLevel(Enum):
|
||||
Auto = ...
|
||||
CheckFeas = ...
|
||||
SolveFixed = ...
|
||||
SolveMIP = ...
|
||||
Repair = ...
|
||||
NoCheck = ...
|
||||
|
||||
class WriteLevel(Enum):
|
||||
Auto = ...
|
||||
AllVars = ...
|
||||
DiscreteVars = ...
|
||||
NonZeroVars = ...
|
||||
NonZeroDiscreteVars = ...
|
||||
|
||||
def filter_zeros(self) -> bool: ...
|
||||
def filter_nondiscrete(self) -> bool: ...
|
15
typings/docplex/mp/constr.pyi
Normal file
15
typings/docplex/mp/constr.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from docplex.mp.operand import LinearOperand
|
||||
|
||||
class AbstractConstraint: ...
|
||||
class BinaryConstraint(AbstractConstraint): ...
|
||||
class LinearConstraint(BinaryConstraint, LinearOperand): ...
|
||||
class RangeConstraint(AbstractConstraint): ...
|
||||
class NotEqualConstraint(LinearConstraint): ...
|
||||
class LogicalConstraint(AbstractConstraint): ...
|
||||
class IndicatorConstraint(LogicalConstraint): ...
|
||||
class EquivalenceConstraint(LogicalConstraint): ...
|
||||
class IfThenConstraint(IndicatorConstraint): ...
|
||||
class QuadraticConstraint(BinaryConstraint): ...
|
||||
class PwlConstraint(AbstractConstraint): ...
|
3
typings/docplex/mp/context.pyi
Normal file
3
typings/docplex/mp/context.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from __future__ import annotations
|
||||
|
||||
class Context: ...
|
49
typings/docplex/mp/dvar.pyi
Normal file
49
typings/docplex/mp/dvar.pyi
Normal file
@@ -0,0 +1,49 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Final, overload
|
||||
|
||||
from docplex.mp.basic import Expr
|
||||
from docplex.mp.linear import LinearExpr, MonomialExpr
|
||||
from docplex.mp.model import Model
|
||||
from docplex.mp.operand import LinearOperand
|
||||
from docplex.mp.quad import QuadExpr
|
||||
from docplex.mp.vartype import VarType
|
||||
|
||||
class Var(LinearOperand):
|
||||
lb: float
|
||||
ub: float
|
||||
vartype: Final[VarType]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
model: Model,
|
||||
vartype: VarType,
|
||||
name: str,
|
||||
lb: float | None = None,
|
||||
ub: float | None = None,
|
||||
) -> None: ...
|
||||
def has_free_lb(self) -> bool: ...
|
||||
def has_free_ub(self) -> bool: ...
|
||||
def is_free(self) -> bool: ...
|
||||
def set_lb(self, ub: float | None) -> None: ...
|
||||
def set_ub(self, ub: float | None) -> None: ...
|
||||
def is_binary(self) -> bool: ...
|
||||
def is_integer(self) -> bool: ...
|
||||
def is_continuous(self) -> bool: ...
|
||||
def is_discrete(self) -> bool: ...
|
||||
def __sub__(self, e: Var | float) -> LinearExpr: ...
|
||||
def __rsub__(self, e: Var | float) -> LinearExpr: ...
|
||||
def __neg__(self) -> MonomialExpr: ...
|
||||
def __add__(self, other: Var | float) -> LinearExpr: ...
|
||||
def __radd__(self, other: Var | float) -> LinearExpr: ...
|
||||
@overload
|
||||
def __mul__(self, other: float) -> MonomialExpr: ...
|
||||
@overload
|
||||
def __mul__(self, other: Var) -> QuadExpr: ...
|
||||
@overload
|
||||
def __mul__(self, other: Expr) -> Expr: ...
|
||||
@overload
|
||||
def __rmul__(self, other: float) -> MonomialExpr: ...
|
||||
@overload
|
||||
def __rmul__(self, other: Expr) -> Expr: ...
|
||||
def __truediv__(self, other: float) -> MonomialExpr: ...
|
39
typings/docplex/mp/functional.pyi
Normal file
39
typings/docplex/mp/functional.pyi
Normal file
@@ -0,0 +1,39 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import overload
|
||||
|
||||
from docplex.mp.basic import Expr
|
||||
from docplex.mp.dvar import Var
|
||||
from docplex.mp.linear import LinearExpr
|
||||
from docplex.mp.operand import LinearOperand
|
||||
from docplex.mp.quad import QuadExpr
|
||||
|
||||
class _FunctionalExpr(Expr, LinearOperand):
|
||||
def __sub__(self, e: Var | float) -> LinearExpr: ...
|
||||
def __rsub__(self, e: Var | float) -> LinearExpr: ...
|
||||
def __neg__(self) -> LinearExpr: ...
|
||||
def __add__(self, other: Var | float) -> LinearExpr: ...
|
||||
def __radd__(self, other: Var | float) -> LinearExpr: ...
|
||||
@overload
|
||||
def __mul__(self, other: float) -> LinearExpr: ...
|
||||
@overload
|
||||
def __mul__(self, other: Var) -> QuadExpr: ...
|
||||
@overload
|
||||
def __mul__(self, other: Expr) -> LinearExpr: ...
|
||||
@overload
|
||||
def __rmul__(self, other: float) -> LinearExpr: ...
|
||||
@overload
|
||||
def __rmul__(self, other: Expr) -> LinearExpr: ...
|
||||
def __div__(self, other: float) -> LinearExpr: ...
|
||||
def __truediv__(self, other: float) -> LinearExpr: ...
|
||||
|
||||
class UnaryFunctionalExpr(_FunctionalExpr): ...
|
||||
class AbsExpr(UnaryFunctionalExpr): ...
|
||||
class _SequenceExpr(_FunctionalExpr): ...
|
||||
class MinimumExpr(_SequenceExpr): ...
|
||||
class MaximumExpr(_SequenceExpr): ...
|
||||
class LogicalNotExpr(UnaryFunctionalExpr): ...
|
||||
class _LogicalSequenceExpr(_SequenceExpr): ...
|
||||
class LogicalAndExpr(_LogicalSequenceExpr): ...
|
||||
class LogicalOrExpr(_LogicalSequenceExpr): ...
|
||||
class PwlExpr(UnaryFunctionalExpr): ...
|
86
typings/docplex/mp/linear.pyi
Normal file
86
typings/docplex/mp/linear.pyi
Normal 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: ...
|
177
typings/docplex/mp/model.pyi
Normal file
177
typings/docplex/mp/model.pyi
Normal file
@@ -0,0 +1,177 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, Iterator, Literal, Sequence, TextIO, TypeVar, overload
|
||||
|
||||
from docplex.mp.basic import Expr
|
||||
from docplex.mp.constants import EffortLevel, ObjectiveSense, WriteLevel
|
||||
from docplex.mp.constr import AbstractConstraint
|
||||
from docplex.mp.context import Context
|
||||
from docplex.mp.dvar import Var
|
||||
from docplex.mp.functional import (
|
||||
AbsExpr,
|
||||
LogicalAndExpr,
|
||||
LogicalNotExpr,
|
||||
LogicalOrExpr,
|
||||
MaximumExpr,
|
||||
MinimumExpr,
|
||||
)
|
||||
from docplex.mp.linear import AbstractLinearExpr, ConstantExpr, LinearExpr, ZeroExpr
|
||||
from docplex.mp.operand import LinearOperand
|
||||
from docplex.mp.params.parameters import RootParameterGroup
|
||||
from docplex.mp.progress import ProgressListener
|
||||
from docplex.mp.solution import SolveSolution
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Key = TypeVar("_Key")
|
||||
_Val = TypeVar("_Val")
|
||||
|
||||
_MethodDictArg: TypeAlias = (
|
||||
dict[_Key, _Val] | list[_Val] | Callable[[_Key], _Val] | _Val
|
||||
)
|
||||
_ObjectiveSense: TypeAlias = (
|
||||
ObjectiveSense | Literal["min", "max", "minimize", "maximize", -1, 1]
|
||||
)
|
||||
|
||||
class Model:
|
||||
def __init__(
|
||||
self, name: str | None = None, context: Context | None = None, **kwargs: Any
|
||||
) -> None: ...
|
||||
def binary_var(self, name: str | None = None) -> Var: ...
|
||||
def binary_var_list(
|
||||
self,
|
||||
keys: int | Sequence[_Key],
|
||||
name: _MethodDictArg[_Key, str] | None = None,
|
||||
key_format: str | None = None,
|
||||
) -> list[Var]: ...
|
||||
def binary_var_dict(
|
||||
self,
|
||||
keys: Iterable[_Key],
|
||||
name: _MethodDictArg[_Key, str] | None = None,
|
||||
key_format: str | None = None,
|
||||
) -> dict[_Key, Var]: ...
|
||||
def integer_var(
|
||||
self, lb: int | None = None, ub: int | None = None, name: str | None = None
|
||||
) -> Var: ...
|
||||
def integer_var_list(
|
||||
self,
|
||||
keys: int | Sequence[_Key],
|
||||
lb: _MethodDictArg[_Key, int] | None = None,
|
||||
ub: _MethodDictArg[_Key, int] | None = None,
|
||||
name: _MethodDictArg[_Key, str] | None = None,
|
||||
key_format: str | None = None,
|
||||
) -> list[Var]: ...
|
||||
def integer_var_dict(
|
||||
self,
|
||||
keys: Iterable[_Key],
|
||||
lb: _MethodDictArg[_Key, int] | None = None,
|
||||
ub: _MethodDictArg[_Key, int] | None = None,
|
||||
name: _MethodDictArg[_Key, str] | None = None,
|
||||
key_format: str | None = None,
|
||||
) -> dict[_Key, Var]: ...
|
||||
def continuous_var(
|
||||
self, lb: float | None = None, ub: float | None = None, name: str | None = None
|
||||
) -> Var: ...
|
||||
def continuous_var_list(
|
||||
self,
|
||||
keys: int | Sequence[_Key],
|
||||
lb: _MethodDictArg[_Key, float] | None = None,
|
||||
ub: _MethodDictArg[_Key, float] | None = None,
|
||||
name: _MethodDictArg[_Key, str] | None = None,
|
||||
key_format: str | None = None,
|
||||
) -> list[Var]: ...
|
||||
def continuous_var_dict(
|
||||
self,
|
||||
keys: Iterable[_Key],
|
||||
lb: _MethodDictArg[_Key, float] | None = None,
|
||||
ub: _MethodDictArg[_Key, float] | None = None,
|
||||
name: _MethodDictArg[_Key, str] | None = None,
|
||||
key_format: str | None = None,
|
||||
) -> dict[_Key, Var]: ...
|
||||
def sum(self, args: Iterable[LinearOperand | float]) -> LinearExpr | ZeroExpr: ...
|
||||
def sums(self, *args: LinearOperand | float) -> LinearExpr | ZeroExpr: ...
|
||||
def add_constraint(
|
||||
self, ct: AbstractConstraint, ctname: str | None = None
|
||||
) -> AbstractConstraint: ...
|
||||
def add_constraints(
|
||||
self, ct: Iterable[AbstractConstraint], names: Iterable[str] | None = None
|
||||
) -> list[AbstractConstraint]: ...
|
||||
def remove_constraints(
|
||||
self,
|
||||
cts: Iterable[AbstractConstraint],
|
||||
error: Literal["raise", "warn"] = "warn",
|
||||
) -> list[AbstractConstraint]: ...
|
||||
@overload
|
||||
def add(
|
||||
self, ct: AbstractConstraint, name: str | None = None
|
||||
) -> AbstractConstraint: ...
|
||||
@overload
|
||||
def add(
|
||||
self, ct: Iterable[AbstractConstraint], name: Iterable[str] | None = None
|
||||
) -> list[AbstractConstraint]: ...
|
||||
def solve(self, **kwargs: Any) -> SolveSolution | None: ...
|
||||
def set_objective(self, sense: _ObjectiveSense, expr: Expr | Var) -> None: ...
|
||||
def set_objective_sense(self, sense: _ObjectiveSense) -> None: ...
|
||||
def set_objective_expr(self, expr: Expr | Var) -> None: ...
|
||||
def set_lex_multi_objective(
|
||||
self,
|
||||
sense: _ObjectiveSense,
|
||||
exprs: Iterable[Expr | Var],
|
||||
abstols: float | None = None,
|
||||
reltols: float | None = None,
|
||||
names: Iterable[str] | None = None,
|
||||
) -> None: ...
|
||||
def get_objective_expr(self) -> Expr: ...
|
||||
def add_mip_start(
|
||||
self,
|
||||
mip_start_sol: SolveSolution,
|
||||
effort_level: EffortLevel | None = None,
|
||||
write_level: WriteLevel | None = None,
|
||||
complete_vars: bool = False,
|
||||
eps_zero: float = 1e-6,
|
||||
) -> SolveSolution: ...
|
||||
@property
|
||||
def log_output(self) -> TextIO | bool: ...
|
||||
@log_output.setter
|
||||
def log_output(self, out: TextIO | bool) -> None: ...
|
||||
def set_log_output(self, out: TextIO) -> None: ...
|
||||
@property
|
||||
def parameters(self) -> RootParameterGroup: ...
|
||||
def problem_type(self) -> Literal["LP", "MILP", "QP", "MIQP", "QCP", "MIQCP"]: ...
|
||||
def print_information(self) -> None: ...
|
||||
def logical_and(
|
||||
self, *args: Var | Expr | LinearOperand
|
||||
) -> Var | AbstractLinearExpr | ConstantExpr | LogicalAndExpr: ...
|
||||
def logical_or(
|
||||
self, *args: Var | Expr | LinearOperand
|
||||
) -> Var | AbstractLinearExpr | ConstantExpr | LogicalOrExpr: ...
|
||||
def logical_not(self, other: Var | Expr) -> LogicalNotExpr: ...
|
||||
def abs(self, e: Var | Expr | float) -> AbsExpr: ...
|
||||
def min(self, *args: Var | Expr | Sequence[Var | Expr]) -> MinimumExpr: ...
|
||||
def max(self, *args: Var | Expr | Sequence[Var | Expr]) -> MaximumExpr: ...
|
||||
def if_then(
|
||||
self,
|
||||
if_ct: AbstractConstraint,
|
||||
then_ct: AbstractConstraint,
|
||||
negate: bool = ...,
|
||||
) -> AbstractConstraint: ...
|
||||
def indicator_constraint(
|
||||
self,
|
||||
binary_var: Var,
|
||||
linear_ct: AbstractConstraint,
|
||||
active_value: Literal[0, 1] = ...,
|
||||
name: str | None = ...,
|
||||
) -> AbstractConstraint: ...
|
||||
def add_indicator(
|
||||
self,
|
||||
binary_var: Var,
|
||||
linear_ct: AbstractConstraint,
|
||||
active_value: Literal[0, 1] = ...,
|
||||
name: str | None = ...,
|
||||
) -> AbstractConstraint: ...
|
||||
def add_progress_listener(self, listener: ProgressListener) -> None: ...
|
||||
def remove_progress_listener(self, listener: ProgressListener) -> None: ...
|
||||
@property
|
||||
def number_of_progress_listeners(self) -> int: ...
|
||||
def iter_progress_listeners(self) -> Iterator[ProgressListener]: ...
|
||||
def clear_progress_listeners(self) -> None: ...
|
12
typings/docplex/mp/operand.pyi
Normal file
12
typings/docplex/mp/operand.pyi
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from docplex.mp.constr import BinaryConstraint, NotEqualConstraint
|
||||
|
||||
class Operand:
|
||||
def negate(self) -> Operand: ...
|
||||
def __le__(self, other: Operand | float) -> BinaryConstraint: ...
|
||||
def __ge__(self, other: Operand | float) -> BinaryConstraint: ...
|
||||
def __eq__(self, other: Operand | float) -> BinaryConstraint: ... # type: ignore
|
||||
|
||||
class LinearOperand(Operand):
|
||||
def __ne__(self, other: Operand | float) -> NotEqualConstraint: ... # type: ignore
|
0
typings/docplex/mp/params/__init__.pyi
Normal file
0
typings/docplex/mp/params/__init__.pyi
Normal file
272
typings/docplex/mp/params/parameters.pyi
Normal file
272
typings/docplex/mp/params/parameters.pyi
Normal file
@@ -0,0 +1,272 @@
|
||||
from __future__ import annotations
|
||||
|
||||
class ParameterGroup:
|
||||
def __init__(
|
||||
self, name: str, parent_group: ParameterGroup | None = None
|
||||
) -> None: ...
|
||||
|
||||
class _BarrierGroup(ParameterGroup):
|
||||
class _BarrierLimitsGroup(ParameterGroup):
|
||||
corrections: int = ...
|
||||
growth: float = ...
|
||||
iteration: int = ...
|
||||
objrange: float = ...
|
||||
|
||||
algorithm: int = ...
|
||||
colnonzeros: int = ...
|
||||
convergetol: float = ...
|
||||
crossover: int = ...
|
||||
display: int = ...
|
||||
ordering: int = ...
|
||||
qcpconvergetol: float = ...
|
||||
startalg: int = ...
|
||||
|
||||
limits: _BarrierLimitsGroup = ...
|
||||
|
||||
class _BendersGroup(ParameterGroup):
|
||||
class _BendersTolerancesGroup(ParameterGroup):
|
||||
feasibilitycut: float = ...
|
||||
optimalitycut: float = ...
|
||||
|
||||
strategy: int = ...
|
||||
workeralgorithm: int = ...
|
||||
|
||||
tolerances: _BendersTolerancesGroup = ...
|
||||
|
||||
class _ConflictGroup(ParameterGroup):
|
||||
algorithm: int = ...
|
||||
display: int = ...
|
||||
|
||||
class _EmphasisGroup(ParameterGroup):
|
||||
memory: bool = ...
|
||||
mip: int = ...
|
||||
numerical: bool = ...
|
||||
|
||||
class _FeasoptGroup(ParameterGroup):
|
||||
mode: int = ...
|
||||
tolerance: float = ...
|
||||
|
||||
class _MipGroup(ParameterGroup):
|
||||
class _MipCutsGroup(ParameterGroup):
|
||||
bqp: int = ...
|
||||
cliques: int = ...
|
||||
covers: int = ...
|
||||
disjunctive: int = ...
|
||||
flowcovers: int = ...
|
||||
gomory: int = ...
|
||||
gubcovers: int = ...
|
||||
implied: int = ...
|
||||
liftproj: int = ...
|
||||
localimplied: int = ...
|
||||
mcfcut: int = ...
|
||||
mircut: int = ...
|
||||
nodecuts: int = ...
|
||||
pathcut: int = ...
|
||||
rlt: int = ...
|
||||
zerohalfcut: int = ...
|
||||
|
||||
class _MipLimitsGroup(ParameterGroup):
|
||||
aggforcut: int = ...
|
||||
auxrootthreads: int = ...
|
||||
lowerobjstop: float = ...
|
||||
cutpasses: int = ...
|
||||
cutsfactor: float = ...
|
||||
eachcutlimit: int = ...
|
||||
gomorycand: int = ...
|
||||
gomorypass: int = ...
|
||||
nodes: int = ...
|
||||
populate: int = ...
|
||||
probedettime: float = ...
|
||||
probetime: float = ...
|
||||
repairtries: int = ...
|
||||
solutions: int = ...
|
||||
strongcand: int = ...
|
||||
strongit: int = ...
|
||||
treememory: float = ...
|
||||
upperobjstop: float = ...
|
||||
|
||||
class _MipPolishafterGroup(ParameterGroup):
|
||||
absmipgap: float = ...
|
||||
dettime: float = ...
|
||||
mipgap: float = ...
|
||||
nodes: int = ...
|
||||
solutions: int = ...
|
||||
time: float = ...
|
||||
|
||||
class _MipPoolGroup(ParameterGroup):
|
||||
absgap: float = ...
|
||||
capacity: int = ...
|
||||
intensity: int = ...
|
||||
relgap: float = ...
|
||||
replace: int = ...
|
||||
|
||||
class _MipstrategyGroup(ParameterGroup):
|
||||
backtrack: float = ...
|
||||
bbinterval: int = ...
|
||||
branch: int = ...
|
||||
dive: int = ...
|
||||
file: int = ...
|
||||
fpheur: int = ...
|
||||
heuristiceffort: float = ...
|
||||
heuristicfreq: int = ...
|
||||
kappastats: int = ...
|
||||
lbheur: bool = ...
|
||||
miqcpstrat: int = ...
|
||||
nodeselect: int = ...
|
||||
order: bool = ...
|
||||
presolvenode: int = ...
|
||||
probe: int = ...
|
||||
rinsheur: int = ...
|
||||
search: int = ...
|
||||
startalgorithm: int = ...
|
||||
subalgorithm: int = ...
|
||||
variableselect: int = ...
|
||||
|
||||
class _MipSubmipGroup(ParameterGroup):
|
||||
startalg: int = ...
|
||||
subalg: int = ...
|
||||
nodelimit: int = ...
|
||||
scale: int = ...
|
||||
|
||||
class _MipTolerancesGroup(ParameterGroup):
|
||||
absmipgap: float = ...
|
||||
linearization: float = ...
|
||||
integrality: float = ...
|
||||
lowercutoff: float = ...
|
||||
mipgap: float = ...
|
||||
objdifference: float = ...
|
||||
relobjdifference: float = ...
|
||||
uppercutoff: float = ...
|
||||
|
||||
display: int = ...
|
||||
interval: int = ...
|
||||
ordertype: int = ...
|
||||
|
||||
cuts: _MipCutsGroup = ...
|
||||
limits: _MipLimitsGroup = ...
|
||||
polishafter: _MipPolishafterGroup = ...
|
||||
pool: _MipPoolGroup = ...
|
||||
strategy: _MipstrategyGroup = ...
|
||||
submip: _MipSubmipGroup = ...
|
||||
tolerances: _MipTolerancesGroup = ...
|
||||
|
||||
class _MultiobjectiveGroup(ParameterGroup):
|
||||
display: int = ...
|
||||
|
||||
class _NetworkGroup(ParameterGroup):
|
||||
class _NetworkTolerancesGroup(ParameterGroup):
|
||||
feasibility: float = ...
|
||||
optimality: float = ...
|
||||
|
||||
display: int = ...
|
||||
iterations: int = ...
|
||||
netfind: int = ...
|
||||
pricing: int = ...
|
||||
|
||||
tolerances: _NetworkTolerancesGroup = ...
|
||||
|
||||
class _OutputGroup(ParameterGroup):
|
||||
intsolfileprefix: str = ...
|
||||
mpslong: bool = ...
|
||||
writelevel: int = ...
|
||||
|
||||
class _PreprocessingGroup(ParameterGroup):
|
||||
aggregator: int = ...
|
||||
boundstrength: int = ...
|
||||
coeffreduce: int = ...
|
||||
dependency: int = ...
|
||||
dual: int = ...
|
||||
fill: int = ...
|
||||
folding: int = ...
|
||||
numpass: int = ...
|
||||
presolve: bool = ...
|
||||
qcpduals: int = ...
|
||||
qpmakepsd: bool = ...
|
||||
qtolin: int = ...
|
||||
reduce: int = ...
|
||||
reformulations: int = ...
|
||||
relax: int = ...
|
||||
repeatpresolve: int = ...
|
||||
sos1reform: int = ...
|
||||
sos2reform: int = ...
|
||||
symmetry: int = ...
|
||||
|
||||
class _ReadGroup(ParameterGroup):
|
||||
datacheck: int = ...
|
||||
fileencoding: str = ...
|
||||
scale: int = ...
|
||||
warninglimit: int = ...
|
||||
|
||||
class _SiftingGroup(ParameterGroup):
|
||||
algorithm: int = ...
|
||||
simplex: bool = ...
|
||||
display: int = ...
|
||||
iterations: int = ...
|
||||
|
||||
class _SimplexGroup(ParameterGroup):
|
||||
class _SimplexLimitsGroup(ParameterGroup):
|
||||
iterations: int = ...
|
||||
lowerobj: float = ...
|
||||
perturbation: int = ...
|
||||
singularity: int = ...
|
||||
upperobj: float = ...
|
||||
|
||||
class _SimplexPerturbationGroup(ParameterGroup):
|
||||
constant: float = ...
|
||||
indicator: bool = ...
|
||||
|
||||
class _SimplexTolerancesGroup(ParameterGroup):
|
||||
feasibility: float = ...
|
||||
markowitz: float = ...
|
||||
optimality: float = ...
|
||||
|
||||
crash: int = ...
|
||||
dgradient: int = ...
|
||||
display: int = ...
|
||||
dynamicrows: int = ...
|
||||
pgradient: int = ...
|
||||
pricing: int = ...
|
||||
refactor: int = ...
|
||||
|
||||
limits: _SimplexLimitsGroup = ...
|
||||
perturbation: _SimplexPerturbationGroup = ...
|
||||
tolerances: _SimplexTolerancesGroup = ...
|
||||
|
||||
class _TuneGroup(ParameterGroup):
|
||||
dettimelimit: float = ...
|
||||
display: int = ...
|
||||
measure: int = ...
|
||||
repeat: int = ...
|
||||
timelimit: float = ...
|
||||
|
||||
class RootParameterGroup(ParameterGroup):
|
||||
advance: int = ...
|
||||
clocktype: int = ...
|
||||
dettimelimit: float = ...
|
||||
lpmethod: int = ...
|
||||
optimalitytarget: int = ...
|
||||
parallel: int = ...
|
||||
paramdisplay: bool = ...
|
||||
qpmethod: int = ...
|
||||
randomseed: int = ...
|
||||
record: bool = ...
|
||||
solutiontype: int = ...
|
||||
threads: int = ...
|
||||
timelimit: float = ...
|
||||
workdir: str = ...
|
||||
workmem: float = ...
|
||||
|
||||
barrier: _BarrierGroup = ...
|
||||
benders: _BendersGroup = ...
|
||||
conflict: _ConflictGroup = ...
|
||||
emphasis: _EmphasisGroup = ...
|
||||
feasopt: _FeasoptGroup = ...
|
||||
mip: _MipGroup = ...
|
||||
multiobjective: _MultiobjectiveGroup = ...
|
||||
network: _NetworkGroup = ...
|
||||
output: _OutputGroup = ...
|
||||
preprocessing: _PreprocessingGroup = ...
|
||||
read: _ReadGroup = ...
|
||||
sifting: _SiftingGroup = ...
|
||||
simplex: _SimplexGroup = ...
|
||||
tune: _TuneGroup = ...
|
192
typings/docplex/mp/progress.pyi
Normal file
192
typings/docplex/mp/progress.pyi
Normal file
@@ -0,0 +1,192 @@
|
||||
from collections.abc import Mapping, Sequence
|
||||
from enum import Enum
|
||||
from typing import Callable, Iterator, Literal, NamedTuple, Protocol
|
||||
|
||||
from docplex.mp.model import Model
|
||||
from docplex.mp.solution import SolveSolution
|
||||
|
||||
class ProgressData(NamedTuple):
|
||||
has_incumbent: bool
|
||||
current_objective: float | None
|
||||
best_bound: float
|
||||
mip_gap: float | None
|
||||
current_nb_iterations: int
|
||||
current_nb_nodes: int
|
||||
remaining_nb_nodes: int
|
||||
time: float
|
||||
det_time: float
|
||||
|
||||
class ProgressClock(Enum):
|
||||
All = ...
|
||||
Solutions = ...
|
||||
BestBound = ...
|
||||
Objective = ...
|
||||
Gap = ...
|
||||
|
||||
@property
|
||||
def listens_to_solution(self) -> bool: ...
|
||||
|
||||
class _Filter(Protocol):
|
||||
def accept(self, data: ProgressData) -> bool: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
class _AbstractProgressListener:
|
||||
def abort(self) -> None: ...
|
||||
def notify_start(self) -> None: ...
|
||||
|
||||
class ProgressListener(_AbstractProgressListener):
|
||||
"""The base class for progress listeners."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
clock_ar: ProgressClock = ...,
|
||||
absdiff: float | None = None,
|
||||
reldiff: float | None = None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def clock(self) -> ProgressClock: ...
|
||||
@property
|
||||
def abs_diff(self) -> float: ...
|
||||
@property
|
||||
def relative_diff(self) -> float: ...
|
||||
@property
|
||||
def current_progress_data(self) -> ProgressData | None: ...
|
||||
def accept(self, pdata: ProgressData) -> bool: ...
|
||||
def requires_solution(self) -> bool: ...
|
||||
def notify_solution(self, s: SolveSolution) -> None: ...
|
||||
def notify_jobid(self, jobid: int) -> None: ...
|
||||
def notify_end(self, status: int, objective: float | None) -> None: ...
|
||||
def notify_progress(self, progress_data: ProgressData) -> None: ...
|
||||
|
||||
class FilterAcceptAll:
|
||||
def accept(self, pdata: ProgressData) -> bool: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
class FilterAcceptAllSolutions(object):
|
||||
def accept(self, pdata: ProgressData) -> bool: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
class Watcher:
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
absdiff: float,
|
||||
reldiff: float,
|
||||
update_fn: Callable[[ProgressData], bool],
|
||||
) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
def accept(self, progress_data: ProgressData) -> bool: ...
|
||||
def sync(self, pdata: ProgressData) -> None: ...
|
||||
|
||||
class ClockFilter:
|
||||
def __init__(
|
||||
self,
|
||||
level: ProgressClock,
|
||||
obj_absdiff: float,
|
||||
bbound_absdiff: float,
|
||||
obj_reldiff: float = ...,
|
||||
bbound_reldiff: float = ...,
|
||||
node_delta: int = ...,
|
||||
) -> None: ...
|
||||
def accept(self, progress_data: ProgressData) -> bool: ...
|
||||
def peek(self, progress_data: ProgressData) -> Watcher | None: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
class TextProgressListener(ProgressListener):
|
||||
def __init__(
|
||||
self,
|
||||
clock: ProgressClock = ...,
|
||||
gap_fmt: str | None = ...,
|
||||
obj_fmt: str | None = ...,
|
||||
absdiff: float | None = ...,
|
||||
reldiff: float | None = ...,
|
||||
) -> None: ...
|
||||
def notify_start(self) -> None: ...
|
||||
def notify_progress(self, progress_data: ProgressData) -> None: ...
|
||||
|
||||
class ProgressDataRecorder(ProgressListener):
|
||||
"""A specialized class of ProgressListener, which collects all ProgressData it receives."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
clock: ProgressClock = ...,
|
||||
absdiff: float | None = ...,
|
||||
reldiff: float | None = ...,
|
||||
) -> None: ...
|
||||
def notify_start(self) -> None: ...
|
||||
def notify_progress(self, progress_data: ProgressData) -> None: ...
|
||||
@property
|
||||
def number_of_records(self) -> int: ...
|
||||
@property
|
||||
def iter_recorded(self) -> Iterator[ProgressData]: ...
|
||||
@property
|
||||
def recorded(self) -> Sequence[ProgressData]: ...
|
||||
|
||||
class SolutionListener(ProgressListener):
|
||||
def __init__(
|
||||
self,
|
||||
clock: Literal[
|
||||
ProgressClock.Solutions, ProgressClock.Objective, ProgressClock.Gap
|
||||
] = ...,
|
||||
absdiff: float | None = ...,
|
||||
reldiff: float | None = ...,
|
||||
) -> None: ...
|
||||
def requires_solution(self) -> bool: ...
|
||||
def notify_solution(self, s: SolveSolution) -> None: ...
|
||||
def notify_start(self) -> None: ...
|
||||
def accept(self, pdata: ProgressData) -> bool: ...
|
||||
|
||||
class SolutionRecorder(SolutionListener):
|
||||
def __init__(
|
||||
self,
|
||||
clock: Literal[
|
||||
ProgressClock.Solutions, ProgressClock.Objective, ProgressClock.Gap
|
||||
] = ...,
|
||||
absdiff: float | None = ...,
|
||||
reldiff: float | None = ...,
|
||||
) -> None: ...
|
||||
def notify_start(self) -> None: ...
|
||||
def notify_solution(self, s: SolveSolution) -> None: ...
|
||||
def iter_solutions(self) -> Iterator[SolveSolution]: ...
|
||||
@property
|
||||
def number_of_solutions(self) -> int: ...
|
||||
@property
|
||||
def current_solution(self) -> SolveSolution | None: ...
|
||||
|
||||
class FunctionalSolutionListener(SolutionListener):
|
||||
def __init__(
|
||||
self,
|
||||
solution_fn: Callable[[SolveSolution], None],
|
||||
clock: Literal[
|
||||
ProgressClock.Solutions, ProgressClock.Objective, ProgressClock.Gap
|
||||
] = ...,
|
||||
absdiff: float | None = ...,
|
||||
reldiff: float | None = ...,
|
||||
) -> None: ...
|
||||
def notify_solution(self, s: SolveSolution) -> None: ...
|
||||
|
||||
class KpiListener(SolutionListener):
|
||||
def __init__(
|
||||
self,
|
||||
model: Model,
|
||||
clock: Literal[
|
||||
ProgressClock.Solutions, ProgressClock.Objective, ProgressClock.Gap
|
||||
] = ...,
|
||||
absdiff: float | None = ...,
|
||||
reldiff: float | None = ...,
|
||||
) -> None: ...
|
||||
def publish(self, kpi_dict: Mapping[str, float | str]) -> None: ...
|
||||
def notify_solution(self, s: SolveSolution) -> None: ...
|
||||
|
||||
class KpiPrinter(KpiListener):
|
||||
def __init__(
|
||||
self,
|
||||
model: Model,
|
||||
clock: Literal[
|
||||
ProgressClock.Solutions, ProgressClock.Objective, ProgressClock.Gap
|
||||
] = ...,
|
||||
absdiff: float | None = ...,
|
||||
reldiff: float | None = ...,
|
||||
kpi_format: str = ...,
|
||||
) -> None: ...
|
||||
def publish(self, kpi_dict: Mapping[str, float | str]) -> None: ...
|
5
typings/docplex/mp/quad.pyi
Normal file
5
typings/docplex/mp/quad.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from docplex.mp.basic import Expr
|
||||
|
||||
class QuadExpr(Expr): ...
|
29
typings/docplex/mp/sdetails.pyi
Normal file
29
typings/docplex/mp/sdetails.pyi
Normal file
@@ -0,0 +1,29 @@
|
||||
from __future__ import annotations
|
||||
|
||||
class SolveDetails:
|
||||
@property
|
||||
def time(self) -> float: ...
|
||||
@property
|
||||
def status_code(self) -> int: ...
|
||||
@property
|
||||
def status(self) -> str: ...
|
||||
@property
|
||||
def problem_type(self) -> str: ...
|
||||
@property
|
||||
def columns(self) -> int: ...
|
||||
@property
|
||||
def nb_linear_nonzeros(self) -> int: ...
|
||||
@property
|
||||
def mip_relative_gap(self) -> float: ...
|
||||
|
||||
gap = mip_relative_gap
|
||||
|
||||
@property
|
||||
def best_bound(self) -> float: ...
|
||||
@property
|
||||
def nb_iterations(self) -> int | tuple[int, ...]: ...
|
||||
@property
|
||||
def nb_nodes_processed(self) -> int | tuple[int, ...]: ...
|
||||
def print_information(self) -> None: ...
|
||||
def to_string(self) -> str: ...
|
||||
def has_hit_limit(self) -> bool: ...
|
49
typings/docplex/mp/solution.pyi
Normal file
49
typings/docplex/mp/solution.pyi
Normal file
@@ -0,0 +1,49 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterable, Mapping
|
||||
from typing import Literal, Sequence, TypeVar
|
||||
|
||||
from docplex.mp.constants import WriteLevel
|
||||
from docplex.mp.dvar import Var
|
||||
from docplex.mp.model import Model
|
||||
from docplex.mp.sdetails import SolveDetails
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Key = TypeVar("_Key")
|
||||
_SolvedBy: TypeAlias = Literal["cplex_local", "cplex_cloud"] | None
|
||||
|
||||
class SolveSolution:
|
||||
def __init__(
|
||||
self,
|
||||
model: Model,
|
||||
var_value_map: Mapping[Var, float] | None = None,
|
||||
obj: Sequence[float] | float | None = None,
|
||||
blended_obj_by_priority: Sequence[float] | None = None,
|
||||
name: str | None = None,
|
||||
solved_by: _SolvedBy = None,
|
||||
keep_zeros: bool = True,
|
||||
) -> None: ...
|
||||
@property
|
||||
def problem_name(self) -> str: ...
|
||||
@property
|
||||
def solved_by(self) -> _SolvedBy: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def solve_details(self) -> SolveDetails: ...
|
||||
def get_objective_value(self) -> float | list[float]: ...
|
||||
def get_value(self, arg: Var) -> float: ...
|
||||
def get_values(self, var_seq: Iterable[Var]) -> list[float]: ...
|
||||
def get_value_list(self, dvars: Iterable[Var]) -> list[float]: ...
|
||||
def get_value_dict(
|
||||
self,
|
||||
var_dict: Mapping[_Key, Var],
|
||||
keep_zeros: bool = True,
|
||||
precision: float = 1e-6,
|
||||
) -> dict[_Key, float]: ...
|
||||
def as_mip_start(
|
||||
self,
|
||||
write_level: WriteLevel = ...,
|
||||
complete_vars: bool = False,
|
||||
eps_zero: float = 1e-6,
|
||||
) -> SolveSolution: ...
|
11
typings/docplex/mp/vartype.pyi
Normal file
11
typings/docplex/mp/vartype.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
class VarType:
|
||||
def is_semi_type(self) -> bool: ...
|
||||
def is_discrete(self) -> bool: ...
|
||||
|
||||
class BinaryVarType(VarType): ...
|
||||
class ContinuousVarType(VarType): ...
|
||||
class IntegerVarType(VarType): ...
|
||||
class SemiContinuousVarType(VarType): ...
|
||||
class SemiDiscreteVarType(VarType): ...
|
Reference in New Issue
Block a user