InvalidConstraintError

(class from pyomo.common.errors)

class pyomo.common.errors.InvalidConstraintError(*args)[source]

Bases: InvalidExpressionError

Exception raised for constraints that cannot be represented or emitted.

Pyomo will raise this exception when:

  • Creating a constraint with a trivial (Boolean) expression.

  • Creating a constraint from an incorrectly structured tuple.

  • Compiling a ranged constraint (lb <= body <= ub) where either lb or ub are variable expressions.

  • Compiling a constraint that cannot be expressed / written in the target format or interface.

__init__(*args)

Member Documentation

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.