MathOps

class modusa.tools.math_ops.MathOps[source]

Bases: ModusaTool

Performs arithmetic and NumPy-style ops.

Note

  • Shape-changing operations like reshape, transpose, etc. are not yet supported. Use only element-wise or aggregation ops for now.

  • Index alignment must be handled carefully in future extensions.

static add(a: Any, b: Any) generic | ndarray[source]
static subtract(a: Any, b: Any) generic | ndarray[source]
static multiply(a: Any, b: Any) generic | ndarray[source]
static divide(a: Any, b: Any) generic | ndarray[source]
static power(a: Any, b: Any) generic | ndarray[source]
static floor_divide(a: Any, b: Any) generic | ndarray[source]
static mean(a: Any, axis: int | None = None) generic | ndarray[source]
static std(a: Any, axis: int | None = None) generic | ndarray[source]
static min(a: Any, axis: int | None = None) generic | ndarray[source]
static max(a: Any, axis: int | None = None) generic | ndarray[source]
static sum(a: Any, axis: int | None = None) generic | ndarray[source]
static sin(a: Any) generic | ndarray[source]
static cos(a: Any) generic | ndarray[source]
static tanh(a: Any) generic | ndarray[source]
static exp(a: Any) generic | ndarray[source]
static log(a: Any) generic | ndarray[source]
static log10(a: Any) generic | ndarray[source]
static log2(a: Any) generic | ndarray[source]
static log1p(a: Any) generic | ndarray[source]
static sqrt(a: Any) generic | ndarray[source]
static abs(a: Any) generic | ndarray[source]
static reshape(a: Any, shape: int | tuple[int, ...]) ndarray[source]