E-TE0507 — Non-scalar comparison operand

Error Type

Type Error

Phase

building constraints

Python exception

jijmodeling.TypeError

Message

Invalid comparison involving an operand of type `{lhs}`.

Comparison operands in this position must be scalar values.

Cause

This error is raised internally when a comparison operand’s type cannot be coerced to a plain scalar kind — for example when a condition that must be data-only involves decision variables.

Fix

Express each condition on decision variables as a separate constraint (conjunction is implicit: all constraints must hold), or reformulate disjunctions with auxiliary binary variables and big-M style modeling. Combinations with & / | may only be used for conditions on data (placeholders and indices), not on decision variables.