E-TE0606 — Wrong number of arguments to min/max

Error Type

Type Error

Phase

building expressions from Python

Python exception

TypeError (builtin)

Message

`jijmodeling.{function}` takes one or two positional arguments.

Possible fix: pass a single tensor-like expression or two expressions.

({function} is min or max, depending on which function was called)

Cause

jm.min or jm.max was called with no positional arguments, or with three or more. Only two call forms exist: one tensor-like expression whose elements are folded, or exactly two expressions to compare. The method forms count the receiver as the first argument, so x.min(y, z) and x.max(y, z) trigger this error as well.

Fix

Pass a single tensor-like expression to fold over all of its elements, or exactly two expressions to take the smaller/larger of the pair. For the minimum or maximum of more than two scalars, nest the calls:

jm.min(A)                   # smallest element of a tensor-like expression
jm.min(a, b)                # smaller of two expressions
jm.min(a, jm.min(b, c))     # smallest of three expressions