From 0988f868b4e75c47374fc7a1555a73d94c78fc03 Mon Sep 17 00:00:00 2001 From: 40% Date: Mon, 8 Jun 2026 21:50:11 +0800 Subject: [PATCH 01/18] refactor: replace Python math with C-level math functions and refactor unary expressions Remove Python math module and use libc.math for C-level functions (fabs, exp, log, sqrt, sin, cos). Refactor unary expression evaluation by introducing specific subclasses (AbsExpr, ExpExpr, LogExpr, SqrtExpr, SinExpr, CosExpr) with dedicated evaluate methods using C functions, replacing the generic UnaryExpr implementation. --- src/pyscipopt/expr.pxi | 73 +++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 15 deletions(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 62f0c880d..2ad9d1492 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -42,7 +42,6 @@ # which should, in princple, modify the expr. However, since we do not implement __isub__, __sub__ # gets called (I guess) and so a copy is returned. # Modifying the expression directly would be a bug, given that the expression might be re-used by the user. -import math from typing import TYPE_CHECKING, Literal, Union import numpy as np @@ -54,6 +53,12 @@ from cpython.number cimport PyNumber_Check from cpython.object cimport Py_LE, Py_EQ, Py_GE, Py_TYPE from cpython.ref cimport PyObject from cpython.tuple cimport PyTuple_GET_ITEM +from libc.math cimport cos as c_cos +from libc.math cimport exp as c_exp +from libc.math cimport fabs as c_fabs +from libc.math cimport log as c_log +from libc.math cimport sqrt as c_sqrt +from libc.math cimport sin as c_sin cimport numpy as cnp from pyscipopt.scip cimport Variable, Solution @@ -279,22 +284,22 @@ cdef class ExprLike: return self * -1.0 def __abs__(self) -> GenExpr: - return UnaryExpr(Operator.fabs, buildGenExprObj(self)) + return AbsExpr(Operator.fabs, buildGenExprObj(self)) def exp(self) -> GenExpr: - return UnaryExpr(Operator.exp, buildGenExprObj(self)) + return ExpExpr(Operator.exp, buildGenExprObj(self)) def log(self) -> GenExpr: - return UnaryExpr(Operator.log, buildGenExprObj(self)) + return LogExpr(Operator.log, buildGenExprObj(self)) def sqrt(self) -> GenExpr: - return UnaryExpr(Operator.sqrt, buildGenExprObj(self)) + return SqrtExpr(Operator.sqrt, buildGenExprObj(self)) def sin(self) -> GenExpr: - return UnaryExpr(Operator.sin, buildGenExprObj(self)) + return SinExpr(Operator.sin, buildGenExprObj(self)) def cos(self) -> GenExpr: - return UnaryExpr(Operator.cos, buildGenExprObj(self)) + return CosExpr(Operator.cos, buildGenExprObj(self)) ##@details Polynomial expressions of variables with operator overloading. \n @@ -799,24 +804,62 @@ cdef class PowExpr(GenExpr): return (self.children[0])._evaluate(sol) ** self.expo -# Exp, Log, Sqrt, Sin, Cos Expressions cdef class UnaryExpr(GenExpr): + def __init__(self, op, expr): self.children = [] self.children.append(expr) self._op = op - def __abs__(self) -> UnaryExpr: - if self._op == "abs": - return self.copy() - return UnaryExpr(Operator.fabs, self) + def __abs__(self) -> AbsExpr: + return AbsExpr(Operator.fabs, self) - def __repr__(self): + def __repr__(self) -> str: return self._op + "(" + self.children[0].__repr__() + ")" + +cdef class AbsExpr(UnaryExpr): + + def __abs__(self) -> AbsExpr: + return self.copy() + + cpdef double _evaluate(self, Solution sol) except *: + return c_fabs((self.children[0])._evaluate(sol)) + + + +cdef class ExpExpr(UnaryExpr): + + cpdef double _evaluate(self, Solution sol) except *: + return c_exp((self.children[0])._evaluate(sol)) + + + +cdef class LogExpr(UnaryExpr): + + cpdef double _evaluate(self, Solution sol) except *: + return c_log((self.children[0])._evaluate(sol)) + + + +cdef class SqrtExpr(UnaryExpr): + + cpdef double _evaluate(self, Solution sol) except *: + return c_sqrt((self.children[0])._evaluate(sol)) + + + +cdef class SinExpr(UnaryExpr): + + cpdef double _evaluate(self, Solution sol) except *: + return c_sin((self.children[0])._evaluate(sol)) + + + +cdef class CosExpr(UnaryExpr): + cpdef double _evaluate(self, Solution sol) except *: - cdef double res = (self.children[0])._evaluate(sol) - return math.fabs(res) if self._op == "abs" else getattr(math, self._op)(res) + return c_cos((self.children[0])._evaluate(sol)) # class for constant expressions From 3c7a98169ee481977a5ce212157b32f61c057f3c Mon Sep 17 00:00:00 2001 From: 40% Date: Mon, 8 Jun 2026 21:50:38 +0800 Subject: [PATCH 02/18] feat(type stubs): add specific unary expression types Update UnaryExpr type stubs to include concrete expression subclasses for more precise type annotations. This change refines the return type of __abs__ and introduces new expression classes. - Change __abs__ return type from GenExpr to AbsExpr - Add AbsExpr, ExpExpr, LogExpr, SqrtExpr, SinExpr, and CosExpr classes - All new classes inherit from UnaryExpr --- src/pyscipopt/scip.pyi | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/pyscipopt/scip.pyi b/src/pyscipopt/scip.pyi index 86196cfc1..11f43139a 100644 --- a/src/pyscipopt/scip.pyi +++ b/src/pyscipopt/scip.pyi @@ -2262,7 +2262,25 @@ class Term: class UnaryExpr(GenExpr): def __init__(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... - def __abs__(self) -> GenExpr: ... + def __abs__(self) -> AbsExpr: ... + +class AbsExpr(UnaryExpr): + ... + +class ExpExpr(UnaryExpr): + ... + +class LogExpr(UnaryExpr): + ... + +class SqrtExpr(UnaryExpr): + ... + +class SinExpr(UnaryExpr): + ... + +class CosExpr(UnaryExpr): + ... @disjoint_base class VarExpr(GenExpr): From 166dc2117ed6e3957c93ade1e3a871c9cde882e6 Mon Sep 17 00:00:00 2001 From: 40% Date: Mon, 8 Jun 2026 21:52:09 +0800 Subject: [PATCH 03/18] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80bea8d07..67e86568c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Changed - Move magic methods (`__radd__`, `__sub__`, `__rsub__`, `__rmul__`, `__richcmp__`, `__neg__`, and `__rtruediv__`) to `ExprLike` base class (#1204) - Speed up `Expr.__add__` and `Expr.__iadd__` via the C-level API +- Replace Python math with C-level math functions and refactor unary expressions. ### Removed ## 6.2.1 - 2026.05.16 From 647f8ac84a8715318dd74482c265cf446feac405 Mon Sep 17 00:00:00 2001 From: 40% Date: Mon, 8 Jun 2026 22:13:23 +0800 Subject: [PATCH 04/18] style(scip): condense UnaryExpr subclass definitions to single lines --- src/pyscipopt/scip.pyi | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/pyscipopt/scip.pyi b/src/pyscipopt/scip.pyi index 11f43139a..8dda7cdd6 100644 --- a/src/pyscipopt/scip.pyi +++ b/src/pyscipopt/scip.pyi @@ -2264,23 +2264,12 @@ class UnaryExpr(GenExpr): def __init__(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... def __abs__(self) -> AbsExpr: ... -class AbsExpr(UnaryExpr): - ... - -class ExpExpr(UnaryExpr): - ... - -class LogExpr(UnaryExpr): - ... - -class SqrtExpr(UnaryExpr): - ... - -class SinExpr(UnaryExpr): - ... - -class CosExpr(UnaryExpr): - ... +class AbsExpr(UnaryExpr): ... +class ExpExpr(UnaryExpr): ... +class LogExpr(UnaryExpr): ... +class SqrtExpr(UnaryExpr): ... +class SinExpr(UnaryExpr): ... +class CosExpr(UnaryExpr): ... @disjoint_base class VarExpr(GenExpr): From fadf4e1dc795c8571b428c180ca1ad17321558d8 Mon Sep 17 00:00:00 2001 From: 40% Date: Tue, 9 Jun 2026 02:11:36 +0000 Subject: [PATCH 05/18] Remove extra blank line --- src/pyscipopt/expr.pxi | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 2ad9d1492..5a2a5740c 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -827,7 +827,6 @@ cdef class AbsExpr(UnaryExpr): return c_fabs((self.children[0])._evaluate(sol)) - cdef class ExpExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: From c27fe01233d96b48acd31c435f58906b630e6800 Mon Sep 17 00:00:00 2001 From: 40% Date: Tue, 9 Jun 2026 20:45:53 +0800 Subject: [PATCH 06/18] Remove extra blank lines --- src/pyscipopt/expr.pxi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 5a2a5740c..eb0317da8 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -833,28 +833,24 @@ cdef class ExpExpr(UnaryExpr): return c_exp((self.children[0])._evaluate(sol)) - cdef class LogExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: return c_log((self.children[0])._evaluate(sol)) - cdef class SqrtExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: return c_sqrt((self.children[0])._evaluate(sol)) - cdef class SinExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: return c_sin((self.children[0])._evaluate(sol)) - cdef class CosExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: From e5bdabcbe5d5e3b6da04b773d3381546a91dc1cc Mon Sep 17 00:00:00 2001 From: 40% Date: Thu, 11 Jun 2026 22:41:06 +0800 Subject: [PATCH 07/18] Simplify via `ExprLike.__abs__` --- src/pyscipopt/expr.pxi | 15 ++++++--------- src/pyscipopt/scip.pyi | 13 ++++++------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index eb0317da8..4e83099b6 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -283,22 +283,22 @@ cdef class ExprLike: def __neg__(self, /) -> Union[Expr, GenExpr]: return self * -1.0 - def __abs__(self) -> GenExpr: + def __abs__(self, /) -> AbsExpr: return AbsExpr(Operator.fabs, buildGenExprObj(self)) - def exp(self) -> GenExpr: + def exp(self, /) -> ExpExpr: return ExpExpr(Operator.exp, buildGenExprObj(self)) - def log(self) -> GenExpr: + def log(self, /) -> LogExpr: return LogExpr(Operator.log, buildGenExprObj(self)) - def sqrt(self) -> GenExpr: + def sqrt(self, /) -> SqrtExpr: return SqrtExpr(Operator.sqrt, buildGenExprObj(self)) - def sin(self) -> GenExpr: + def sin(self, /) -> SinExpr: return SinExpr(Operator.sin, buildGenExprObj(self)) - def cos(self) -> GenExpr: + def cos(self, /) -> CosExpr: return CosExpr(Operator.cos, buildGenExprObj(self)) @@ -811,9 +811,6 @@ cdef class UnaryExpr(GenExpr): self.children.append(expr) self._op = op - def __abs__(self) -> AbsExpr: - return AbsExpr(Operator.fabs, self) - def __repr__(self) -> str: return self._op + "(" + self.children[0].__repr__() + ")" diff --git a/src/pyscipopt/scip.pyi b/src/pyscipopt/scip.pyi index 8dda7cdd6..16b41bc2a 100644 --- a/src/pyscipopt/scip.pyi +++ b/src/pyscipopt/scip.pyi @@ -338,12 +338,12 @@ class ExprLike: def __rmul__(self, other: object, /) -> Incomplete: ... def __rtruediv__(self, other: object, /) -> GenExpr: ... def __neg__(self, /) -> Union[Expr, GenExpr]: ... - def __abs__(self) -> GenExpr: ... - def exp(self) -> GenExpr: ... - def log(self) -> GenExpr: ... - def sqrt(self) -> GenExpr: ... - def sin(self) -> GenExpr: ... - def cos(self) -> GenExpr: ... + def __abs__(self, /) -> AbsExpr: ... + def exp(self, /) -> ExpExpr: ... + def log(self, /) -> LogExpr: ... + def sqrt(self, /) -> SqrtExpr: ... + def sin(self, /) -> SinExpr: ... + def cos(self, /) -> CosExpr: ... @disjoint_base class Expr(ExprLike): @@ -2262,7 +2262,6 @@ class Term: class UnaryExpr(GenExpr): def __init__(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... - def __abs__(self) -> AbsExpr: ... class AbsExpr(UnaryExpr): ... class ExpExpr(UnaryExpr): ... From 8294d8a22cbbe241c9fde3bb14741987e1b018d9 Mon Sep 17 00:00:00 2001 From: 40% Date: Thu, 11 Jun 2026 22:50:50 +0800 Subject: [PATCH 08/18] test C-level math functions --- tests/test_expr.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_expr.py b/tests/test_expr.py index f35096f73..5a3db9cdf 100644 --- a/tests/test_expr.py +++ b/tests/test_expr.py @@ -212,8 +212,16 @@ def test_getVal_with_GenExpr(): assert m.getVal(y / x) == 2 # test "**(prod(1.0,**(sum(0.0,prod(1.0,x)),-1)),2)" assert m.getVal((1 / x) ** 2) == 1 - # test "sin(sum(0.0,prod(1.0,x)))" + + # test C-level math functions + assert m.getVal(abs(x)) == 1 + assert m.getVal(abs(-x)) == 1 + assert m.getVal(abs(abs(-x))) == 1 + assert round(m.getVal(exp(x)), 6) == round(math.exp(1), 6) + assert round(m.getVal(log(x)), 6) == round(math.log(1), 6) + assert round(m.getVal(sqrt(x)), 6) == round(math.sqrt(1), 6) assert round(m.getVal(sin(x)), 6) == round(math.sin(1), 6) + assert round(m.getVal(cos(x)), 6) == round(math.cos(1), 6) with pytest.raises(TypeError): m.getVal(1) From c68176016a526d82e94e3e4802bd46c861edccd8 Mon Sep 17 00:00:00 2001 From: 40% Date: Sun, 21 Jun 2026 09:55:28 +0800 Subject: [PATCH 09/18] let `_evaluate` as the base method --- src/pyscipopt/expr.pxi | 5 +++++ src/pyscipopt/scip.pxd | 3 +-- src/pyscipopt/scip.pyi | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index a869d235d..04cb1a98b 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -304,6 +304,11 @@ cdef class ExprLike: def cos(self, /) -> CosExpr: return CosExpr(Operator.cos, buildGenExprObj(self)) + cpdef double _evaluate(self, Solution sol) except *: + raise NotImplementedError( + f"{self.__class__.__name__!s} need to implement _evaluate() method" + ) + cdef ExprLike copy(self, bint copy=True): raise NotImplementedError( f"{self.__class__.__name__!s} need to implement copy() method" diff --git a/src/pyscipopt/scip.pxd b/src/pyscipopt/scip.pxd index 6db5be281..9217fb8a2 100644 --- a/src/pyscipopt/scip.pxd +++ b/src/pyscipopt/scip.pxd @@ -2152,13 +2152,12 @@ cdef extern from "tpi/tpi.h": cdef class ExprLike: + cpdef double _evaluate(self, Solution sol) cdef ExprLike copy(self, bint copy=*) cdef class Expr(ExprLike): cdef public terms - cpdef double _evaluate(self, Solution sol) - cdef class Event: cdef SCIP_EVENT* event # can be used to store problem data diff --git a/src/pyscipopt/scip.pyi b/src/pyscipopt/scip.pyi index 0881f8bba..6852325f0 100644 --- a/src/pyscipopt/scip.pyi +++ b/src/pyscipopt/scip.pyi @@ -526,7 +526,7 @@ class MatrixConstraint(np.ndarray): def isStickingAtNode(self) -> Incomplete: ... class MatrixExpr(np.ndarray): - def _evaluate(self, sol: Incomplete) -> Incomplete: ... + def _evaluate(self, sol: Solution) -> Incomplete: ... def __array_ufunc__( self, ufunc: np.ufunc, From e5063c03db8a45d84c2709a8f98123877e36ae10 Mon Sep 17 00:00:00 2001 From: 40% Date: Sun, 6 Sep 2026 15:59:37 +0800 Subject: [PATCH 10/18] raise error for log(inputing <= 0) --- src/pyscipopt/expr.pxi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 04cb1a98b..ba5fc8723 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -867,7 +867,10 @@ cdef class ExpExpr(UnaryExpr): cdef class LogExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: - return c_log((self.children[0])._evaluate(sol)) + cdef double val = (self.children[0])._evaluate(sol) + if val <= 0.0: + raise ValueError("math domain error") + return c_log(val) cdef class SqrtExpr(UnaryExpr): From df92b3fb6d8e57eacbde5b5e605a9fc9fe1fb751 Mon Sep 17 00:00:00 2001 From: 40% Date: Sun, 6 Sep 2026 15:59:58 +0800 Subject: [PATCH 11/18] raise error for sqrt(inputing < 0) --- src/pyscipopt/expr.pxi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index ba5fc8723..0f085151a 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -876,7 +876,10 @@ cdef class LogExpr(UnaryExpr): cdef class SqrtExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: - return c_sqrt((self.children[0])._evaluate(sol)) + cdef double val = (self.children[0])._evaluate(sol) + if val < 0.0: + raise ValueError("math domain error") + return c_sqrt(val) cdef class SinExpr(UnaryExpr): From 9db933a5931331563d93a02da57c57dc73a5e94f Mon Sep 17 00:00:00 2001 From: 40% Date: Sun, 6 Sep 2026 16:09:00 +0800 Subject: [PATCH 12/18] replace `float('inf')` with `INFINITY` --- src/pyscipopt/expr.pxi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 0f085151a..3cd9af9fe 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -56,6 +56,7 @@ from cpython.tuple cimport PyTuple_GET_ITEM from libc.math cimport cos as c_cos from libc.math cimport exp as c_exp from libc.math cimport fabs as c_fabs +from libc.math cimport INFINITY from libc.math cimport log as c_log from libc.math cimport sqrt as c_sqrt from libc.math cimport sin as c_sin @@ -721,7 +722,7 @@ cdef class GenExpr(ExprLike): def degree(self): '''Note: none of these expressions should be polynomial''' - return float('inf') + return INFINITY def getOp(self): '''returns operator of GenExpr''' From ad0a9774e37d4ffab7466df472c43835a400a955 Mon Sep 17 00:00:00 2001 From: 40% Date: Sun, 6 Sep 2026 16:12:47 +0800 Subject: [PATCH 13/18] raise error if sin(inputing is inf) --- src/pyscipopt/expr.pxi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 3cd9af9fe..51952593a 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -886,7 +886,10 @@ cdef class SqrtExpr(UnaryExpr): cdef class SinExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: - return c_sin((self.children[0])._evaluate(sol)) + cdef double val = (self.children[0])._evaluate(sol) + if c_fabs(val) == INFINITY: + raise ValueError("math domain error") + return c_sin(val) cdef class CosExpr(UnaryExpr): From d2bda36eb50f77ea3c933a8907041826450106fa Mon Sep 17 00:00:00 2001 From: 40% Date: Sun, 6 Sep 2026 16:12:58 +0800 Subject: [PATCH 14/18] raise error if cos(inputing is inf) --- src/pyscipopt/expr.pxi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 51952593a..22f1eb5dd 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -895,7 +895,10 @@ cdef class SinExpr(UnaryExpr): cdef class CosExpr(UnaryExpr): cpdef double _evaluate(self, Solution sol) except *: - return c_cos((self.children[0])._evaluate(sol)) + cdef double val = (self.children[0])._evaluate(sol) + if c_fabs(val) == INFINITY: + raise ValueError("math domain error") + return c_cos(val) # class for constant expressions From 7683db281b11d698f5bcc2ce775823f51b0d99d7 Mon Sep 17 00:00:00 2001 From: 40% Date: Sun, 6 Sep 2026 16:24:12 +0800 Subject: [PATCH 15/18] add test cases for math domain error --- tests/test_expr.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/test_expr.py b/tests/test_expr.py index 3122df04c..36341e518 100644 --- a/tests/test_expr.py +++ b/tests/test_expr.py @@ -229,6 +229,33 @@ def test_getVal_with_GenExpr(): with pytest.raises(ZeroDivisionError): m.getVal(1 / z) + # math domain errors match the math module + with pytest.raises(ValueError, match="math domain error"): + m.getVal(log(z)) # log(0) + + with pytest.raises(ValueError, match="math domain error"): + m.getVal(log(-y)) # log(-2) + + with pytest.raises(ValueError, match="math domain error"): + m.getVal(sqrt(-y)) # sqrt(-2) + + # sqrt(0) is inside the domain, like math.sqrt(0) + assert m.getVal(sqrt(z)) == 0 + + # +inf is inside log's domain, like math.log(inf) -> inf + assert m.getVal(log(math.inf)) == math.inf + + # sin and cos reject infinite arguments, like math.sin(inf) + with pytest.raises(ValueError, match="math domain error"): + m.getVal(sin(math.inf)) + + with pytest.raises(ValueError, match="math domain error"): + m.getVal(cos(-math.inf)) + + # nested unary expressions propagate the inner domain error + with pytest.raises(ValueError, match="math domain error"): + m.getVal(exp(log(-x))) + def test_unary_ufunc(model): m, x, y, z = model From 261a83bc27cb0eb58f885efc1c875a9e6e9261f8 Mon Sep 17 00:00:00 2001 From: 40% Date: Wed, 9 Sep 2026 12:29:39 +0800 Subject: [PATCH 16/18] Update return types for mathematical functions in scip.pyi --- src/pyscipopt/scip.pyi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pyscipopt/scip.pyi b/src/pyscipopt/scip.pyi index ca9da7d77..a67e1c64f 100644 --- a/src/pyscipopt/scip.pyi +++ b/src/pyscipopt/scip.pyi @@ -31,23 +31,23 @@ str_conversion: Incomplete value_to_array: Incomplete @overload -def exp(x: float | Expr | GenExpr) -> UnaryExpr: ... +def exp(x: float | Expr | GenExpr) -> ExpExpr: ... @overload def exp(x: list | tuple | np.ndarray | MatrixExpr) -> MatrixGenExpr: ... @overload -def log(x: float | Expr | GenExpr) -> UnaryExpr: ... +def log(x: float | Expr | GenExpr) -> LogExpr: ... @overload def log(x: list | tuple | np.ndarray | MatrixExpr) -> MatrixGenExpr: ... @overload -def sqrt(x: float | Expr | GenExpr) -> UnaryExpr: ... +def sqrt(x: float | Expr | GenExpr) -> SqrtExpr: ... @overload def sqrt(x: list | tuple | np.ndarray | MatrixExpr) -> MatrixGenExpr: ... @overload -def sin(x: float | Expr | GenExpr) -> UnaryExpr: ... +def sin(x: float | Expr | GenExpr) -> SinExpr: ... @overload def sin(x: list | tuple | np.ndarray | MatrixExpr) -> MatrixGenExpr: ... @overload -def cos(x: float | Expr | GenExpr) -> UnaryExpr: ... +def cos(x: float | Expr | GenExpr) -> CosExpr: ... @overload def cos(x: list | tuple | np.ndarray | MatrixExpr) -> MatrixGenExpr: ... @@ -420,7 +420,7 @@ class Expr(ExprLike): def __pow__(self, other: int, mod: Incomplete = ..., /) -> Expr: ... @overload def __pow__(self, other: float, mod: Incomplete = ..., /) -> PowExpr: ... - def __rpow__(self, other: float, /) -> UnaryExpr: ... + def __rpow__(self, other: float, /) -> ExpExpr: ... def __getitem__(self, index: Incomplete, /) -> Incomplete: ... def __iter__(self) -> Incomplete: ... @@ -466,7 +466,7 @@ class GenExpr(ExprLike): def __truediv__(self, other: np.ndarray | MatrixExpr, /) -> MatrixExpr: ... def __rtruediv__(self, other: float, /) -> ProdExpr: ... def __pow__(self, other: float | Constant, mod: Incomplete = ..., /) -> PowExpr: ... - def __rpow__(self, other: float, mod: Incomplete = ..., /) -> UnaryExpr: ... + def __rpow__(self, other: float, mod: Incomplete = ..., /) -> ExpExpr: ... @disjoint_base class Heur: From e15d943211e555752a59586b7cadf2bf32c9c189 Mon Sep 17 00:00:00 2001 From: 40% Date: Wed, 9 Sep 2026 14:23:33 +0800 Subject: [PATCH 17/18] update expr mypy baseline for typed unary expressions --- tests/@types/expr.mypy.out | 450 ++++++++++++++++++------------------- 1 file changed, 225 insertions(+), 225 deletions(-) diff --git a/tests/@types/expr.mypy.out b/tests/@types/expr.mypy.out index 9b4d0a53a..d66ed2a72 100644 --- a/tests/@types/expr.mypy.out +++ b/tests/@types/expr.mypy.out @@ -1,7 +1,7 @@ tests/@types/expr.py:86: error: Expression is of type "Any", not "Expr" [assert-type] -tests/@types/expr.py:87: error: Expression is of type "Any", not "Expr" [assert-type] +tests/@types/expr.py:87: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "Expr" [assert-type] tests/@types/expr.py:99: error: Expression is of type "Any", not "Expr" [assert-type] -tests/@types/expr.py:100: error: Expression is of type "Any", not "MatrixExpr" [assert-type] +tests/@types/expr.py:100: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "MatrixExpr" [assert-type] tests/@types/expr.py:104: error: Expression is of type "Any", not "ndarray[tuple[Any, ...], dtype[Any]]" [assert-type] tests/@types/expr.py:104: error: No overload variant of "exp" matches argument type "Term" [call-overload] tests/@types/expr.py:105: error: Expression is of type "Any", not "ndarray[tuple[Any, ...], dtype[Any]]" [assert-type] @@ -13,7 +13,7 @@ tests/@types/expr.py:107: error: No overload variant of "sin" matches argument t tests/@types/expr.py:108: error: Expression is of type "Any", not "ndarray[tuple[Any, ...], dtype[Any]]" [assert-type] tests/@types/expr.py:108: error: No overload variant of "cos" matches argument type "Term" [call-overload] tests/@types/expr.py:154: error: Expression is of type "Any", not "Expr" [assert-type] -tests/@types/expr.py:155: error: Expression is of type "Any", not "MatrixExpr" [assert-type] +tests/@types/expr.py:155: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "MatrixExpr" [assert-type] tests/@types/expr.py:242: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:243: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:244: error: Unused "type: ignore" comment [unused-ignore] @@ -940,7 +940,7 @@ tests/@types/expr.py:3812: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:3827: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:3843: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:3848: error: Expression is of type "Any", not "PowExpr" [assert-type] -tests/@types/expr.py:3848: error: Unsupported operand types for ** ("UnaryExpr" and "Decimal") [operator] +tests/@types/expr.py:3848: error: Unsupported operand types for ** ("AbsExpr" and "Decimal") [operator] tests/@types/expr.py:3849: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:3849: error: No overload variant of "__le__" of "ExprLike" matches argument type "Decimal" [operator] tests/@types/expr.py:3850: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1489,7 +1489,7 @@ tests/@types/expr.py:5351: error: Expression is of type "Any", not "Expr" [asse tests/@types/expr.py:5351: error: Unsupported operand types for - ("Decimal" and "Variable") [operator] tests/@types/expr.py:5352: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:5352: error: Unsupported operand types for * ("Decimal" and "Variable") [operator] -tests/@types/expr.py:5353: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5353: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5353: error: Unsupported operand types for ** ("Decimal" and "Variable") [operator] tests/@types/expr.py:5354: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:5354: error: Unsupported operand types for <= ("Decimal" and "Variable") [operator] @@ -1535,7 +1535,7 @@ tests/@types/expr.py:5406: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:5407: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:5408: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:5409: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:5414: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5414: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5414: error: Unsupported operand types for ** ("Decimal" and "Constant") [operator] tests/@types/expr.py:5415: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:5415: error: Unsupported operand types for <= ("Decimal" and "Constant") [operator] @@ -1549,7 +1549,7 @@ tests/@types/expr.py:5431: error: Expression is of type "Any", not "Expr" [asse tests/@types/expr.py:5431: error: Unsupported operand types for - ("Decimal" and "Expr") [operator] tests/@types/expr.py:5432: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:5432: error: Unsupported operand types for * ("Decimal" and "Expr") [operator] -tests/@types/expr.py:5433: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5433: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5433: error: Unsupported operand types for ** ("Decimal" and "Expr") [operator] tests/@types/expr.py:5434: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:5434: error: Unsupported operand types for <= ("Decimal" and "Expr") [operator] @@ -1574,7 +1574,7 @@ tests/@types/expr.py:5455: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:5456: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:5457: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:5458: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:5462: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5462: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5462: error: Unsupported operand types for ** ("Decimal" and "SumExpr") [operator] tests/@types/expr.py:5463: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:5463: error: Unsupported operand types for <= ("Decimal" and "SumExpr") [operator] @@ -1582,7 +1582,7 @@ tests/@types/expr.py:5464: error: Expression is of type "Any", not "ExprCons" [ tests/@types/expr.py:5464: error: Unsupported operand types for >= ("Decimal" and "SumExpr") [operator] tests/@types/expr.py:5465: error: Expression is of type "bool", not "ExprCons" [assert-type] tests/@types/expr.py:5473: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:5478: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5478: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5478: error: Unsupported operand types for ** ("Decimal" and "ProdExpr") [operator] tests/@types/expr.py:5479: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:5479: error: Unsupported operand types for <= ("Decimal" and "ProdExpr") [operator] @@ -1590,7 +1590,7 @@ tests/@types/expr.py:5480: error: Expression is of type "Any", not "ExprCons" [ tests/@types/expr.py:5480: error: Unsupported operand types for >= ("Decimal" and "ProdExpr") [operator] tests/@types/expr.py:5481: error: Expression is of type "bool", not "ExprCons" [assert-type] tests/@types/expr.py:5489: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:5494: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5494: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5494: error: Unsupported operand types for ** ("Decimal" and "PowExpr") [operator] tests/@types/expr.py:5495: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:5495: error: Unsupported operand types for <= ("Decimal" and "PowExpr") [operator] @@ -1598,15 +1598,15 @@ tests/@types/expr.py:5496: error: Expression is of type "Any", not "ExprCons" [ tests/@types/expr.py:5496: error: Unsupported operand types for >= ("Decimal" and "PowExpr") [operator] tests/@types/expr.py:5497: error: Expression is of type "bool", not "ExprCons" [assert-type] tests/@types/expr.py:5505: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:5510: error: Expression is of type "Any", not "UnaryExpr" [assert-type] -tests/@types/expr.py:5510: error: Unsupported operand types for ** ("Decimal" and "UnaryExpr") [operator] +tests/@types/expr.py:5510: error: Expression is of type "Any", not "ExpExpr" [assert-type] +tests/@types/expr.py:5510: error: Unsupported operand types for ** ("Decimal" and "AbsExpr") [operator] tests/@types/expr.py:5511: error: Expression is of type "Any", not "ExprCons" [assert-type] -tests/@types/expr.py:5511: error: Unsupported operand types for <= ("Decimal" and "UnaryExpr") [operator] +tests/@types/expr.py:5511: error: Unsupported operand types for <= ("Decimal" and "AbsExpr") [operator] tests/@types/expr.py:5512: error: Expression is of type "Any", not "ExprCons" [assert-type] -tests/@types/expr.py:5512: error: Unsupported operand types for >= ("Decimal" and "UnaryExpr") [operator] +tests/@types/expr.py:5512: error: Unsupported operand types for >= ("Decimal" and "AbsExpr") [operator] tests/@types/expr.py:5513: error: Expression is of type "bool", not "ExprCons" [assert-type] tests/@types/expr.py:5521: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:5526: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5526: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5526: error: Unsupported operand types for ** ("Decimal" and "VarExpr") [operator] tests/@types/expr.py:5527: error: Expression is of type "Any", not "ExprCons" [assert-type] tests/@types/expr.py:5527: error: Unsupported operand types for <= ("Decimal" and "VarExpr") [operator] @@ -1719,7 +1719,7 @@ tests/@types/expr.py:5798: error: Expression is of type "Any", not "Expr" [asse tests/@types/expr.py:5799: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:5800: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:5801: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5802: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5802: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5803: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5804: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5805: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1761,7 +1761,7 @@ tests/@types/expr.py:5862: error: Expression is of type "Any", not "SumExpr" [a tests/@types/expr.py:5863: error: Expression is of type "Any", not "SumExpr" [assert-type] tests/@types/expr.py:5864: error: Expression is of type "Any", not "ProdExpr" [assert-type] tests/@types/expr.py:5865: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5866: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5866: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5867: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5868: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5869: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1773,7 +1773,7 @@ tests/@types/expr.py:5878: error: Expression is of type "Any", not "Expr" [asse tests/@types/expr.py:5879: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:5880: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:5881: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5882: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5882: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5883: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5884: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5885: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1794,7 +1794,7 @@ tests/@types/expr.py:5910: error: Expression is of type "Any", not "SumExpr" [a tests/@types/expr.py:5911: error: Expression is of type "Any", not "SumExpr" [assert-type] tests/@types/expr.py:5912: error: Expression is of type "Any", not "ProdExpr" [assert-type] tests/@types/expr.py:5913: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5914: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5914: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5915: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5916: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5917: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1806,7 +1806,7 @@ tests/@types/expr.py:5926: error: Expression is of type "Any", not "SumExpr" [a tests/@types/expr.py:5927: error: Expression is of type "Any", not "SumExpr" [assert-type] tests/@types/expr.py:5928: error: Expression is of type "Any", not "ProdExpr" [assert-type] tests/@types/expr.py:5929: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5930: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5930: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5931: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5932: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5933: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1818,7 +1818,7 @@ tests/@types/expr.py:5942: error: Expression is of type "Any", not "SumExpr" [a tests/@types/expr.py:5943: error: Expression is of type "Any", not "SumExpr" [assert-type] tests/@types/expr.py:5944: error: Expression is of type "Any", not "ProdExpr" [assert-type] tests/@types/expr.py:5945: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5946: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5946: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5947: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5948: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5949: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1830,7 +1830,7 @@ tests/@types/expr.py:5958: error: Expression is of type "Any", not "SumExpr" [a tests/@types/expr.py:5959: error: Expression is of type "Any", not "SumExpr" [assert-type] tests/@types/expr.py:5960: error: Expression is of type "Any", not "ProdExpr" [assert-type] tests/@types/expr.py:5961: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5962: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5962: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5963: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5964: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5965: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -1842,7 +1842,7 @@ tests/@types/expr.py:5974: error: Expression is of type "Any", not "SumExpr" [a tests/@types/expr.py:5975: error: Expression is of type "Any", not "SumExpr" [assert-type] tests/@types/expr.py:5976: error: Expression is of type "Any", not "ProdExpr" [assert-type] tests/@types/expr.py:5977: error: Expression is of type "Any", not "ProdExpr" [assert-type] -tests/@types/expr.py:5978: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:5978: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:5979: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5980: error: Expression is of type "ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]", not "ExprCons" [assert-type] tests/@types/expr.py:5981: error: Expression is of type "Any", not "ExprCons" [assert-type] @@ -3335,161 +3335,161 @@ tests/@types/expr.py:14099: error: Incompatible types in assignment (expression tests/@types/expr.py:14100: error: Expression is of type "PowExpr", not "MatrixExpr" [assert-type] tests/@types/expr.py:14105: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:14110: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:14118: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14119: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14124: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14125: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14130: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14131: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14136: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14137: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14155: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14156: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14161: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14162: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14167: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14168: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14173: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14174: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14118: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14119: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14124: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14125: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14130: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14131: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14136: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14137: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14155: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14156: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14161: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14162: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14167: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14168: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14173: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14174: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] tests/@types/expr.py:14184: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:14192: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14193: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14198: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14199: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14204: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14205: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14210: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14211: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14192: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14193: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14198: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14199: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14204: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14205: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14210: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14211: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] tests/@types/expr.py:14221: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:14262: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14263: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14268: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14269: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14274: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14275: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14280: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14281: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14286: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14287: error: Expression is of type "UnaryExpr", not "PowExpr" [assert-type] -tests/@types/expr.py:14300: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14301: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14306: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14307: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14312: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14313: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14318: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14319: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14337: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14338: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14343: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14344: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14349: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14350: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14355: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14356: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14262: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14263: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14268: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14269: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14274: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14275: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14280: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14281: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14286: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14287: error: Expression is of type "AbsExpr", not "PowExpr" [assert-type] +tests/@types/expr.py:14300: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14301: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14306: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14307: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14312: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14313: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14318: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14319: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14337: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14338: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14343: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14344: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14349: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14350: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14355: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14356: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] tests/@types/expr.py:14366: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:14374: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14375: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14380: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14381: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14386: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14387: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14392: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14393: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14411: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14412: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14417: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14418: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14423: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14424: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14429: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14430: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14448: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14449: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14454: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14455: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14460: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14461: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14466: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14467: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14485: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14486: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14491: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14492: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14497: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14498: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14503: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14504: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14522: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14523: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14528: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14529: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14534: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14535: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14540: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14541: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14374: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14375: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14380: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14381: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14386: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14387: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14392: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14393: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14411: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14412: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14417: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14418: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14423: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14424: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14429: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14430: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14448: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14449: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14454: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14455: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14460: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14461: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14466: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14467: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14485: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14486: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14491: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14492: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14497: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14498: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14503: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14504: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14522: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14523: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14528: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14529: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14534: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14535: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14540: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14541: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] tests/@types/expr.py:14612: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:14617: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:14625: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14626: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14631: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14632: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14637: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14638: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14643: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14644: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14649: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14650: error: Expression is of type "UnaryExpr", not "PowExpr" [assert-type] -tests/@types/expr.py:14663: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14664: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14669: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14670: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14675: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14676: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14681: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14682: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14687: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14688: error: Expression is of type "UnaryExpr", not "PowExpr" [assert-type] -tests/@types/expr.py:14721: error: Unsupported operand types for ** ("UnaryExpr" and "Decimal") [operator] +tests/@types/expr.py:14625: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14626: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14631: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14632: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14637: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14638: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14643: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14644: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14649: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14650: error: Expression is of type "AbsExpr", not "PowExpr" [assert-type] +tests/@types/expr.py:14663: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14664: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14669: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14670: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14675: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14676: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14681: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14682: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14687: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14688: error: Expression is of type "AbsExpr", not "PowExpr" [assert-type] +tests/@types/expr.py:14721: error: Unsupported operand types for ** ("AbsExpr" and "Decimal") [operator] tests/@types/expr.py:14722: error: Expression is of type "Any", not "PowExpr" [assert-type] -tests/@types/expr.py:14735: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14736: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14741: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14742: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14747: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14748: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14753: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14754: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14759: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14760: error: Expression is of type "UnaryExpr", not "PowExpr" [assert-type] -tests/@types/expr.py:14773: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14774: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14779: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14780: error: Expression is of type "UnaryExpr", not "SumExpr" [assert-type] -tests/@types/expr.py:14785: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14786: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] -tests/@types/expr.py:14791: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14792: error: Expression is of type "UnaryExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14735: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14736: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14741: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14742: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14747: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14748: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14753: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14754: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14759: error: Incompatible types in assignment (expression has type "PowExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14760: error: Expression is of type "AbsExpr", not "PowExpr" [assert-type] +tests/@types/expr.py:14773: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14774: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14779: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14780: error: Expression is of type "AbsExpr", not "SumExpr" [assert-type] +tests/@types/expr.py:14785: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14786: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] +tests/@types/expr.py:14791: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14792: error: Expression is of type "AbsExpr", not "ProdExpr" [assert-type] tests/@types/expr.py:14797: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:14802: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:14810: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14811: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14816: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14817: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14822: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14823: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14828: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14829: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14810: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14811: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14816: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14817: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14822: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14823: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14828: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14829: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] tests/@types/expr.py:14834: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:14839: error: Unused "type: ignore" comment [unused-ignore] -tests/@types/expr.py:14847: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14848: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14853: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14854: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14859: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14860: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] -tests/@types/expr.py:14865: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "UnaryExpr") [assignment] -tests/@types/expr.py:14866: error: Expression is of type "UnaryExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14847: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14848: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14853: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14854: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14859: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14860: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] +tests/@types/expr.py:14865: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "AbsExpr") [assignment] +tests/@types/expr.py:14866: error: Expression is of type "AbsExpr", not "MatrixExpr" [assert-type] tests/@types/expr.py:14871: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:14876: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:14884: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "VarExpr") [assignment] @@ -3810,8 +3810,8 @@ tests/@types/expr.py:17048: error: Incompatible types in assignment (expression tests/@types/expr.py:17049: error: Expression is of type "int", not "Expr" [assert-type] tests/@types/expr.py:17054: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17055: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17060: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17061: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17060: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17061: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17074: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "int") [assignment] tests/@types/expr.py:17075: error: Expression is of type "int", not "MatrixExpr" [assert-type] tests/@types/expr.py:17080: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "int") [assignment] @@ -3840,8 +3840,8 @@ tests/@types/expr.py:17195: error: Incompatible types in assignment (expression tests/@types/expr.py:17196: error: Expression is of type "int", not "ProdExpr" [assert-type] tests/@types/expr.py:17201: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17202: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17207: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17208: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17207: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17208: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17221: error: Incompatible types in assignment (expression has type "Expr", variable has type "int") [assignment] tests/@types/expr.py:17222: error: Expression is of type "int", not "Expr" [assert-type] tests/@types/expr.py:17227: error: Incompatible types in assignment (expression has type "Expr", variable has type "int") [assignment] @@ -3850,8 +3850,8 @@ tests/@types/expr.py:17233: error: Incompatible types in assignment (expression tests/@types/expr.py:17234: error: Expression is of type "int", not "Expr" [assert-type] tests/@types/expr.py:17239: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17240: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17245: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17246: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17245: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17246: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17259: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "int") [assignment] tests/@types/expr.py:17260: error: Expression is of type "int", not "MatrixExpr" [assert-type] tests/@types/expr.py:17265: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "int") [assignment] @@ -3870,8 +3870,8 @@ tests/@types/expr.py:17309: error: Incompatible types in assignment (expression tests/@types/expr.py:17310: error: Expression is of type "int", not "ProdExpr" [assert-type] tests/@types/expr.py:17315: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17316: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17321: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17322: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17321: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17322: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17335: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] tests/@types/expr.py:17336: error: Expression is of type "int", not "SumExpr" [assert-type] tests/@types/expr.py:17341: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] @@ -3880,8 +3880,8 @@ tests/@types/expr.py:17347: error: Incompatible types in assignment (expression tests/@types/expr.py:17348: error: Expression is of type "int", not "ProdExpr" [assert-type] tests/@types/expr.py:17353: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17354: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17359: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17360: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17359: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17360: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17373: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] tests/@types/expr.py:17374: error: Expression is of type "int", not "SumExpr" [assert-type] tests/@types/expr.py:17379: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] @@ -3890,8 +3890,8 @@ tests/@types/expr.py:17385: error: Incompatible types in assignment (expression tests/@types/expr.py:17386: error: Expression is of type "int", not "ProdExpr" [assert-type] tests/@types/expr.py:17391: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17392: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17397: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17398: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17397: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17398: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17411: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] tests/@types/expr.py:17412: error: Expression is of type "int", not "SumExpr" [assert-type] tests/@types/expr.py:17417: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] @@ -3900,8 +3900,8 @@ tests/@types/expr.py:17423: error: Incompatible types in assignment (expression tests/@types/expr.py:17424: error: Expression is of type "int", not "ProdExpr" [assert-type] tests/@types/expr.py:17429: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17430: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17435: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17436: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17435: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17436: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17449: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] tests/@types/expr.py:17450: error: Expression is of type "int", not "SumExpr" [assert-type] tests/@types/expr.py:17455: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "int") [assignment] @@ -3910,8 +3910,8 @@ tests/@types/expr.py:17461: error: Incompatible types in assignment (expression tests/@types/expr.py:17462: error: Expression is of type "int", not "ProdExpr" [assert-type] tests/@types/expr.py:17467: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "int") [assignment] tests/@types/expr.py:17468: error: Expression is of type "int", not "ProdExpr" [assert-type] -tests/@types/expr.py:17473: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "int") [assignment] -tests/@types/expr.py:17474: error: Expression is of type "int", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17473: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "int") [assignment] +tests/@types/expr.py:17474: error: Expression is of type "int", not "ExpExpr" [assert-type] tests/@types/expr.py:17553: error: Incompatible types in assignment (expression has type "Expr", variable has type "float") [assignment] tests/@types/expr.py:17554: error: Expression is of type "float", not "Expr" [assert-type] tests/@types/expr.py:17559: error: Incompatible types in assignment (expression has type "Expr", variable has type "float") [assignment] @@ -3920,8 +3920,8 @@ tests/@types/expr.py:17565: error: Incompatible types in assignment (expression tests/@types/expr.py:17566: error: Expression is of type "float", not "Expr" [assert-type] tests/@types/expr.py:17571: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17572: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17577: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17578: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17577: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17578: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:17591: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float") [assignment] tests/@types/expr.py:17592: error: Expression is of type "float", not "MatrixExpr" [assert-type] tests/@types/expr.py:17597: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float") [assignment] @@ -3950,8 +3950,8 @@ tests/@types/expr.py:17712: error: Incompatible types in assignment (expression tests/@types/expr.py:17713: error: Expression is of type "float", not "ProdExpr" [assert-type] tests/@types/expr.py:17718: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17719: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17724: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17725: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17724: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17725: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:17738: error: Incompatible types in assignment (expression has type "Expr", variable has type "float") [assignment] tests/@types/expr.py:17739: error: Expression is of type "float", not "Expr" [assert-type] tests/@types/expr.py:17744: error: Incompatible types in assignment (expression has type "Expr", variable has type "float") [assignment] @@ -3960,8 +3960,8 @@ tests/@types/expr.py:17750: error: Incompatible types in assignment (expression tests/@types/expr.py:17751: error: Expression is of type "float", not "Expr" [assert-type] tests/@types/expr.py:17756: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17757: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17762: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17763: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17762: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17763: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:17776: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float") [assignment] tests/@types/expr.py:17777: error: Expression is of type "float", not "MatrixExpr" [assert-type] tests/@types/expr.py:17782: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float") [assignment] @@ -3980,8 +3980,8 @@ tests/@types/expr.py:17826: error: Incompatible types in assignment (expression tests/@types/expr.py:17827: error: Expression is of type "float", not "ProdExpr" [assert-type] tests/@types/expr.py:17832: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17833: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17838: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17839: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17838: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17839: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:17852: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] tests/@types/expr.py:17853: error: Expression is of type "float", not "SumExpr" [assert-type] tests/@types/expr.py:17858: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] @@ -3990,8 +3990,8 @@ tests/@types/expr.py:17864: error: Incompatible types in assignment (expression tests/@types/expr.py:17865: error: Expression is of type "float", not "ProdExpr" [assert-type] tests/@types/expr.py:17870: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17871: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17876: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17877: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17876: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17877: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:17890: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] tests/@types/expr.py:17891: error: Expression is of type "float", not "SumExpr" [assert-type] tests/@types/expr.py:17896: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] @@ -4000,8 +4000,8 @@ tests/@types/expr.py:17902: error: Incompatible types in assignment (expression tests/@types/expr.py:17903: error: Expression is of type "float", not "ProdExpr" [assert-type] tests/@types/expr.py:17908: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17909: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17914: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17915: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17914: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17915: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:17928: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] tests/@types/expr.py:17929: error: Expression is of type "float", not "SumExpr" [assert-type] tests/@types/expr.py:17934: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] @@ -4010,8 +4010,8 @@ tests/@types/expr.py:17940: error: Incompatible types in assignment (expression tests/@types/expr.py:17941: error: Expression is of type "float", not "ProdExpr" [assert-type] tests/@types/expr.py:17946: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17947: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17952: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17953: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17952: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17953: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:17966: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] tests/@types/expr.py:17967: error: Expression is of type "float", not "SumExpr" [assert-type] tests/@types/expr.py:17972: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float") [assignment] @@ -4020,8 +4020,8 @@ tests/@types/expr.py:17978: error: Incompatible types in assignment (expression tests/@types/expr.py:17979: error: Expression is of type "float", not "ProdExpr" [assert-type] tests/@types/expr.py:17984: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float") [assignment] tests/@types/expr.py:17985: error: Expression is of type "float", not "ProdExpr" [assert-type] -tests/@types/expr.py:17990: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float") [assignment] -tests/@types/expr.py:17991: error: Expression is of type "float", not "UnaryExpr" [assert-type] +tests/@types/expr.py:17990: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float") [assignment] +tests/@types/expr.py:17991: error: Expression is of type "float", not "ExpExpr" [assert-type] tests/@types/expr.py:18070: error: Unsupported operand types for + ("Decimal" and "Variable") [operator] tests/@types/expr.py:18071: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:18076: error: Unsupported operand types for - ("Decimal" and "Variable") [operator] @@ -4029,7 +4029,7 @@ tests/@types/expr.py:18077: error: Expression is of type "Any", not "Expr" [ass tests/@types/expr.py:18082: error: Unsupported operand types for * ("Decimal" and "Variable") [operator] tests/@types/expr.py:18083: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:18093: error: Unsupported operand types for ** ("Decimal" and "Variable") [operator] -tests/@types/expr.py:18094: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18094: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:18107: error: Unsupported operand types for + ("Decimal" and "MatrixVariable") [operator] tests/@types/expr.py:18108: error: Expression is of type "Any", not "MatrixExpr" [assert-type] tests/@types/expr.py:18113: error: Unsupported operand types for - ("Decimal" and "MatrixVariable") [operator] @@ -4049,7 +4049,7 @@ tests/@types/expr.py:18167: error: Unsupported operand types for ** ("Decimal" a tests/@types/expr.py:18168: error: Expression is of type "Any", not "MatrixExpr" [assert-type] tests/@types/expr.py:18173: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:18234: error: Unsupported operand types for ** ("Decimal" and "Constant") [operator] -tests/@types/expr.py:18235: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18235: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:18248: error: Unsupported operand types for + ("Decimal" and "Expr") [operator] tests/@types/expr.py:18249: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:18254: error: Unsupported operand types for - ("Decimal" and "Expr") [operator] @@ -4057,7 +4057,7 @@ tests/@types/expr.py:18255: error: Expression is of type "Any", not "Expr" [ass tests/@types/expr.py:18260: error: Unsupported operand types for * ("Decimal" and "Expr") [operator] tests/@types/expr.py:18261: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:18271: error: Unsupported operand types for ** ("Decimal" and "Expr") [operator] -tests/@types/expr.py:18272: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18272: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:18285: error: Unsupported operand types for + ("Decimal" and "MatrixExpr") [operator] tests/@types/expr.py:18286: error: Expression is of type "Any", not "MatrixExpr" [assert-type] tests/@types/expr.py:18291: error: Unsupported operand types for - ("Decimal" and "MatrixExpr") [operator] @@ -4068,15 +4068,15 @@ tests/@types/expr.py:18308: error: Unsupported operand types for ** ("Decimal" a tests/@types/expr.py:18309: error: Expression is of type "Any", not "MatrixExpr" [assert-type] tests/@types/expr.py:18314: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:18342: error: Unsupported operand types for ** ("Decimal" and "SumExpr") [operator] -tests/@types/expr.py:18343: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18343: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:18376: error: Unsupported operand types for ** ("Decimal" and "ProdExpr") [operator] -tests/@types/expr.py:18377: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18377: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:18410: error: Unsupported operand types for ** ("Decimal" and "PowExpr") [operator] -tests/@types/expr.py:18411: error: Expression is of type "Any", not "UnaryExpr" [assert-type] -tests/@types/expr.py:18444: error: Unsupported operand types for ** ("Decimal" and "UnaryExpr") [operator] -tests/@types/expr.py:18445: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18411: error: Expression is of type "Any", not "ExpExpr" [assert-type] +tests/@types/expr.py:18444: error: Unsupported operand types for ** ("Decimal" and "AbsExpr") [operator] +tests/@types/expr.py:18445: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:18478: error: Unsupported operand types for ** ("Decimal" and "VarExpr") [operator] -tests/@types/expr.py:18479: error: Expression is of type "Any", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18479: error: Expression is of type "Any", not "ExpExpr" [assert-type] tests/@types/expr.py:18525: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:18530: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:18535: error: Unused "type: ignore" comment [unused-ignore] @@ -4091,8 +4091,8 @@ tests/@types/expr.py:18570: error: Incompatible types in assignment (expression tests/@types/expr.py:18571: error: Expression is of type "float64", not "Expr" [assert-type] tests/@types/expr.py:18576: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18577: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:18582: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:18583: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18582: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:18583: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:18596: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float64") [assignment] tests/@types/expr.py:18597: error: Expression is of type "float64", not "MatrixExpr" [assert-type] tests/@types/expr.py:18602: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float64") [assignment] @@ -4131,8 +4131,8 @@ tests/@types/expr.py:18722: error: Incompatible types in assignment (expression tests/@types/expr.py:18723: error: Expression is of type "float64", not "ProdExpr" [assert-type] tests/@types/expr.py:18728: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18729: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:18734: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:18735: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18734: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:18735: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:18748: error: Incompatible types in assignment (expression has type "Expr", variable has type "float64") [assignment] tests/@types/expr.py:18749: error: Expression is of type "float64", not "Expr" [assert-type] tests/@types/expr.py:18754: error: Incompatible types in assignment (expression has type "Expr", variable has type "float64") [assignment] @@ -4141,8 +4141,8 @@ tests/@types/expr.py:18760: error: Incompatible types in assignment (expression tests/@types/expr.py:18761: error: Expression is of type "float64", not "Expr" [assert-type] tests/@types/expr.py:18766: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18767: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:18772: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:18773: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18772: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:18773: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:18786: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float64") [assignment] tests/@types/expr.py:18787: error: Expression is of type "float64", not "MatrixExpr" [assert-type] tests/@types/expr.py:18792: error: Incompatible types in assignment (expression has type "MatrixExpr", variable has type "float64") [assignment] @@ -4161,8 +4161,8 @@ tests/@types/expr.py:18836: error: Incompatible types in assignment (expression tests/@types/expr.py:18837: error: Expression is of type "float64", not "ProdExpr" [assert-type] tests/@types/expr.py:18842: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18843: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:18848: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:18849: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18848: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:18849: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:18862: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] tests/@types/expr.py:18863: error: Expression is of type "float64", not "SumExpr" [assert-type] tests/@types/expr.py:18868: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] @@ -4171,8 +4171,8 @@ tests/@types/expr.py:18874: error: Incompatible types in assignment (expression tests/@types/expr.py:18875: error: Expression is of type "float64", not "ProdExpr" [assert-type] tests/@types/expr.py:18880: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18881: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:18886: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:18887: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18886: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:18887: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:18900: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] tests/@types/expr.py:18901: error: Expression is of type "float64", not "SumExpr" [assert-type] tests/@types/expr.py:18906: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] @@ -4181,8 +4181,8 @@ tests/@types/expr.py:18912: error: Incompatible types in assignment (expression tests/@types/expr.py:18913: error: Expression is of type "float64", not "ProdExpr" [assert-type] tests/@types/expr.py:18918: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18919: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:18924: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:18925: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18924: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:18925: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:18938: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] tests/@types/expr.py:18939: error: Expression is of type "float64", not "SumExpr" [assert-type] tests/@types/expr.py:18944: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] @@ -4191,8 +4191,8 @@ tests/@types/expr.py:18950: error: Incompatible types in assignment (expression tests/@types/expr.py:18951: error: Expression is of type "float64", not "ProdExpr" [assert-type] tests/@types/expr.py:18956: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18957: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:18962: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:18963: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:18962: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:18963: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:18976: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] tests/@types/expr.py:18977: error: Expression is of type "float64", not "SumExpr" [assert-type] tests/@types/expr.py:18982: error: Incompatible types in assignment (expression has type "SumExpr", variable has type "float64") [assignment] @@ -4201,8 +4201,8 @@ tests/@types/expr.py:18988: error: Incompatible types in assignment (expression tests/@types/expr.py:18989: error: Expression is of type "float64", not "ProdExpr" [assert-type] tests/@types/expr.py:18994: error: Incompatible types in assignment (expression has type "ProdExpr", variable has type "float64") [assignment] tests/@types/expr.py:18995: error: Expression is of type "float64", not "ProdExpr" [assert-type] -tests/@types/expr.py:19000: error: Incompatible types in assignment (expression has type "UnaryExpr", variable has type "float64") [assignment] -tests/@types/expr.py:19001: error: Expression is of type "float64", not "UnaryExpr" [assert-type] +tests/@types/expr.py:19000: error: Incompatible types in assignment (expression has type "ExpExpr", variable has type "float64") [assignment] +tests/@types/expr.py:19001: error: Expression is of type "float64", not "ExpExpr" [assert-type] tests/@types/expr.py:19080: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:19085: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:19090: error: Unused "type: ignore" comment [unused-ignore] From 623a742d295b174c822a7db486d5561d80dcb70e Mon Sep 17 00:00:00 2001 From: 40% Date: Wed, 9 Sep 2026 14:55:34 +0800 Subject: [PATCH 18/18] Fix mypy type errors and unused ignore comments Updated mypy output to reflect changes in type assertions and unused comments. --- tests/@types/expr.mypy.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/@types/expr.mypy.out b/tests/@types/expr.mypy.out index d66ed2a72..f08246ebb 100644 --- a/tests/@types/expr.mypy.out +++ b/tests/@types/expr.mypy.out @@ -1,7 +1,7 @@ tests/@types/expr.py:86: error: Expression is of type "Any", not "Expr" [assert-type] -tests/@types/expr.py:87: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "Expr" [assert-type] +tests/@types/expr.py:87: error: Expression is of type "Any", not "Expr" [assert-type] tests/@types/expr.py:99: error: Expression is of type "Any", not "Expr" [assert-type] -tests/@types/expr.py:100: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "MatrixExpr" [assert-type] +tests/@types/expr.py:100: error: Expression is of type "Any", not "MatrixExpr" [assert-type] tests/@types/expr.py:104: error: Expression is of type "Any", not "ndarray[tuple[Any, ...], dtype[Any]]" [assert-type] tests/@types/expr.py:104: error: No overload variant of "exp" matches argument type "Term" [call-overload] tests/@types/expr.py:105: error: Expression is of type "Any", not "ndarray[tuple[Any, ...], dtype[Any]]" [assert-type] @@ -13,7 +13,7 @@ tests/@types/expr.py:107: error: No overload variant of "sin" matches argument t tests/@types/expr.py:108: error: Expression is of type "Any", not "ndarray[tuple[Any, ...], dtype[Any]]" [assert-type] tests/@types/expr.py:108: error: No overload variant of "cos" matches argument type "Term" [call-overload] tests/@types/expr.py:154: error: Expression is of type "Any", not "Expr" [assert-type] -tests/@types/expr.py:155: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "MatrixExpr" [assert-type] +tests/@types/expr.py:155: error: Expression is of type "Any", not "MatrixExpr" [assert-type] tests/@types/expr.py:242: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:243: error: Unused "type: ignore" comment [unused-ignore] tests/@types/expr.py:244: error: Unused "type: ignore" comment [unused-ignore]