RegisterLogicalType

(function from pyomo.common.numeric_types)

pyomo.common.numeric_types.RegisterLogicalType(new_type: type)[source]

Register the specified type as a “logical type”.

A utility function for registering new types as “native logical types”. Logical types can be leaf nodes in Pyomo logical expressions. The type should be compatible with bool (that is, store a scalar and be castable to a Python bool).

Note that logical types are NOT registered as numeric types.

Parameters:

new_type (type) – The new logical type (e.g, numpy.bool_)