Skip to content

Commit 908ac9c

Browse files
Fix stubtest checks
1 parent c43b014 commit 908ac9c

2 files changed

Lines changed: 32 additions & 26 deletions

File tree

src/pyscipopt/scip.pyi

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ class Conshdlr:
252252
class Constant(GenExpr):
253253
number: Incomplete
254254
def __init__(self, *args: Incomplete, **kwargs: Incomplete) -> None: ...
255-
def __pow__(
255+
def __pow__( # type: ignore[override]
256256
self, other: float | Constant, modulo: Incomplete = ..., /
257-
) -> Constant: ... # type: ignore[override]
257+
) -> Constant: ...
258258

259259
@disjoint_base
260260
class Constraint:
@@ -447,28 +447,26 @@ class GenExpr(ExprLike):
447447
@overload
448448
def __add__(self, other: float | ExprLike, /) -> SumExpr: ...
449449
@overload
450-
def __add__(self, other: np.ndarray | MatrixExpr) -> MatrixExpr: ...
450+
def __add__(self, other: np.ndarray | MatrixExpr, /) -> MatrixExpr: ...
451451
def __radd__(self, other: float, /) -> SumExpr: ...
452452
@overload
453453
def __sub__(self, other: float | ExprLike, /) -> SumExpr: ...
454454
@overload
455-
def __sub__(self, other: np.ndarray | MatrixExpr) -> MatrixExpr: ...
455+
def __sub__(self, other: np.ndarray | MatrixExpr, /) -> MatrixExpr: ...
456456
def __rsub__(self, other: float, /) -> SumExpr: ...
457457
@overload
458458
def __mul__(self, other: float | ExprLike, /) -> ProdExpr: ...
459459
@overload
460-
def __mul__(self, other: np.ndarray | MatrixExpr) -> MatrixExpr: ...
460+
def __mul__(self, other: np.ndarray | MatrixExpr, /) -> MatrixExpr: ...
461461
def __rmul__(self, other: float, /) -> ProdExpr: ...
462462
@overload
463463
def __truediv__(self, other: float | ExprLike, /) -> ProdExpr: ...
464464
@overload
465-
def __truediv__(self, other: np.ndarray | MatrixExpr) -> MatrixExpr: ...
465+
def __truediv__(self, other: np.ndarray | MatrixExpr, /) -> MatrixExpr: ...
466466
def __rtruediv__(self, other: float, /) -> ProdExpr: ...
467467
def __ne__(self, other: object, /) -> bool: ...
468-
def __pow__(
469-
self, other: float | Constant, modulo: Incomplete = ..., /
470-
) -> PowExpr: ...
471-
def __rpow__(self, other: float, /) -> UnaryExpr: ...
468+
def __pow__(self, other: float | Constant, mod: Incomplete = ..., /) -> PowExpr: ...
469+
def __rpow__(self, other: float, mod: Incomplete = ..., /) -> UnaryExpr: ...
472470

473471
@disjoint_base
474472
class Heur:
@@ -600,34 +598,36 @@ class MatrixExpr(np.ndarray):
600598
) -> Incomplete: ...
601599
def __neg__(self, /) -> MatrixExpr: ...
602600
def __abs__(self, /) -> MatrixExpr: ...
603-
def __add__(
601+
def __add__( # type: ignore[override]
604602
self, other: float | ExprLike | np.ndarray | MatrixExpr, /
605-
) -> MatrixExpr: ... # type: ignore[override]
603+
) -> MatrixExpr: ...
606604
def __radd__(self, other: float, /) -> MatrixExpr: ... # type: ignore[override]
607-
def __sub__(
605+
def __sub__( # type: ignore[override]
608606
self, other: float | ExprLike | np.ndarray | MatrixExpr, /
609-
) -> MatrixExpr: ... # type: ignore[override]
607+
) -> MatrixExpr: ...
610608
def __rsub__(self, other: float, /) -> MatrixExpr: ... # type: ignore[override]
611-
def __mul__(
609+
def __mul__( # type: ignore[override]
612610
self, other: float | ExprLike | np.ndarray | MatrixExpr, /
613-
) -> MatrixExpr: ... # type: ignore[override]
611+
) -> MatrixExpr: ...
614612
def __rmul__(self, other: float, /) -> MatrixExpr: ... # type: ignore[override]
615-
def __truediv__(
613+
def __truediv__( # type: ignore[override]
616614
self, other: float | ExprLike | np.ndarray | MatrixExpr, /
617-
) -> MatrixExpr: ... # type: ignore[override]
615+
) -> MatrixExpr: ...
618616
def __rtruediv__(self, other: float, /) -> MatrixExpr: ... # type: ignore[override]
619-
def __eq__(
617+
def __eq__( # type: ignore[override]
620618
self, other: float | ExprLike | np.ndarray | MatrixExpr, /
621-
) -> MatrixExprCons: ... # type: ignore[override]
622-
def __le__(
619+
) -> MatrixExprCons: ...
620+
def __le__( # type: ignore[override]
623621
self, other: float | ExprLike | np.ndarray | MatrixExpr, /
624-
) -> MatrixExprCons: ... # type: ignore[override]
625-
def __ge__(
622+
) -> MatrixExprCons: ...
623+
def __ge__( # type: ignore[override]
626624
self, other: float | ExprLike | np.ndarray | MatrixExpr, /
627-
) -> MatrixExprCons: ... # type: ignore[override]
625+
) -> MatrixExprCons: ...
628626
def __matmul__(self, other: np.ndarray | MatrixExpr, /) -> MatrixExpr: ... # type: ignore[override]
629-
def __pow__(self, other: float | np.ndarray, /) -> MatrixExpr: ... # type: ignore[override]
630-
def __rpow__(self, other: float, /) -> MatrixExpr: ... # type: ignore[override]
627+
def __pow__( # type: ignore[override]
628+
self, other: float | np.ndarray, mod: Incomplete = ..., /
629+
) -> MatrixExpr: ...
630+
def __rpow__(self, other: float, mod: Incomplete = ..., /) -> MatrixExpr: ... # type: ignore[override]
631631

632632
class MatrixExprCons(np.ndarray):
633633
def __array_ufunc__(

stubs/allowlist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
.*.__reduce_cython__
22
.*.__setstate_cython__
33
pyscipopt.scip.__test__
4+
# These exist at runtime but aren't useful in the stubs, they are added to the child classes
5+
pyscipopt.scip.ExprLike.__radd__
6+
pyscipopt.scip.ExprLike.__rmul__
7+
pyscipopt.scip.ExprLike.__rsub__
8+
pyscipopt.scip.ExprLike.__rtruediv__
9+
pyscipopt.scip.ExprLike.__sub__

0 commit comments

Comments
 (0)