However, I’m having trouble converting an int value into the corresponding enum in a jit func. The below works fine without jitting
from enum import IntEnum from numba import njit class Bool(IntEnum): FALSE = 1 TRUE = 2 # @njit() def func(val): return Bool(val) print(func(1))
but fails with this error when jitted.
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of IntEnum class(Bool) with parameters (int64)
No type info available for IntEnum class(Bool) as a callable.
During: resolving callee type: IntEnum class(Bool)
I’m sure I’m doing something silly, but I didn’t find an example that did this in either the tests or generally poking about on the net.