diff --git a/CHANGELOG.md b/CHANGELOG.md index ae37c3270..746e9c7bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ - Made `test_markDoNotAggrVar_and_getStatus` robust to SCIP presolve changes by discovering the aggregated/multi-aggregated variables instead of hardcoding them ### 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 +- Speed up `Expr.__add__` and `Expr.__iadd__` via the C-level API (#1205) +- Replace Python math with C-level math functions and refactor unary expressions (#1224) - Extended `structured_optimization_trace` recipe to support context-managed JSONL tracing with final `run_end` records, alongside the existing attach-style in-memory tracing. ### Removed diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 3b232fea2..22f1eb5dd 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,13 @@ 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 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 cimport numpy as cnp from pyscipopt.scip cimport Variable, Solution @@ -281,23 +287,28 @@ cdef class ExprLike: def __pos__(self, /) -> Union[Expr, GenExpr]: return self.copy() - def __abs__(self) -> GenExpr: - return UnaryExpr(Operator.fabs, buildGenExprObj(self)) + def __abs__(self, /) -> AbsExpr: + return AbsExpr(Operator.fabs, buildGenExprObj(self)) - def exp(self) -> GenExpr: - return UnaryExpr(Operator.exp, buildGenExprObj(self)) + def exp(self, /) -> ExpExpr: + return ExpExpr(Operator.exp, buildGenExprObj(self)) - def log(self) -> GenExpr: - return UnaryExpr(Operator.log, buildGenExprObj(self)) + def log(self, /) -> LogExpr: + return LogExpr(Operator.log, buildGenExprObj(self)) - def sqrt(self) -> GenExpr: - return UnaryExpr(Operator.sqrt, buildGenExprObj(self)) + def sqrt(self, /) -> SqrtExpr: + return SqrtExpr(Operator.sqrt, buildGenExprObj(self)) - def sin(self) -> GenExpr: - return UnaryExpr(Operator.sin, buildGenExprObj(self)) + def sin(self, /) -> SinExpr: + return SinExpr(Operator.sin, buildGenExprObj(self)) - def cos(self) -> GenExpr: - return UnaryExpr(Operator.cos, buildGenExprObj(self)) + 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( @@ -711,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''' @@ -828,24 +839,66 @@ cdef class PowExpr(GenExpr): return res -# 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 __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 *: + 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): + + cpdef double _evaluate(self, Solution sol) except *: + 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): + + cpdef double _evaluate(self, Solution sol) except *: + 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): + 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) + 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 diff --git a/src/pyscipopt/scip.pxd b/src/pyscipopt/scip.pxd index 3a126f4dc..4144f91ca 100644 --- a/src/pyscipopt/scip.pxd +++ b/src/pyscipopt/scip.pxd @@ -2156,13 +2156,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 1e3164109..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: ... @@ -355,12 +355,12 @@ class ExprLike: **kwargs: Incomplete, ) -> Incomplete: ... def __pos__(self, /) -> Self: ... - def __abs__(self, /) -> UnaryExpr: ... - def exp(self) -> UnaryExpr: ... - def log(self) -> UnaryExpr: ... - def sqrt(self) -> UnaryExpr: ... - def sin(self) -> UnaryExpr: ... - def cos(self) -> UnaryExpr: ... + def __abs__(self, /) -> AbsExpr: ... + def exp(self, /) -> ExpExpr: ... + def log(self, /) -> LogExpr: ... + def sqrt(self, /) -> SqrtExpr: ... + def sin(self, /) -> SinExpr: ... + def cos(self, /) -> CosExpr: ... @overload def __le__(self, other: float | ExprLike, /) -> ExprCons: ... @overload @@ -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: @@ -588,7 +588,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, @@ -2342,6 +2342,13 @@ class Term: class UnaryExpr(GenExpr): def __init__(self, *args: Incomplete, **kwargs: Incomplete) -> None: ... +class AbsExpr(UnaryExpr): ... +class ExpExpr(UnaryExpr): ... +class LogExpr(UnaryExpr): ... +class SqrtExpr(UnaryExpr): ... +class SinExpr(UnaryExpr): ... +class CosExpr(UnaryExpr): ... + @disjoint_base class VarExpr(GenExpr): var: Incomplete diff --git a/tests/@types/expr.mypy.out b/tests/@types/expr.mypy.out index 9b4d0a53a..f08246ebb 100644 --- a/tests/@types/expr.mypy.out +++ b/tests/@types/expr.mypy.out @@ -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] diff --git a/tests/test_expr.py b/tests/test_expr.py index 1b51e4f2a..36341e518 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) @@ -221,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