E-CE0604 — Invalid constraint hint name type

Error Type

Compile Error

Phase

configuring constraint detection

Python exception

TypeError (builtin)

Message

Expected a `ConstraintHintName` or a string naming a constraint hint, but got `{type_name}`.

Possible fix: pass values such as `"onehot"` or `"sos1"` in `constraint_hints`.

({type_name} is the Python type of the offending value)

Cause

A value passed where a constraint hint name is expected — typically an element of the constraint_hints list of ConstraintDetectionConfig — was neither a ConstraintHintName value nor a string. For example, constraint_hints=[1] or constraint_hints=[None] raises this error.

Fix

Fill constraint_hints with strings or ConstraintHintName values:

import jijmodeling as jm

config = jm.ConstraintDetectionConfig(constraint_hints=["onehot"])
# equivalently:
config = jm.ConstraintDetectionConfig(
    constraint_hints=[jm.ConstraintHintName.OneHot],
)

To detect all supported hints, omit constraint_hints entirely; the default is ConstraintDetectionConfig.default_hints().