I am trying to find how to use @jitclass with an Enum class. The reference manual says explicitly that they are supported but I can't figure it out, and I cannot find a code example anywhere.
When I try running
from numba import jitclass
from numba.types import string
from enum import Enum
type_spec = [
('A', string),
('B', string)
]
@jitclass(type_spec)
class Type(Enum):
A = 'A'
B = 'B'
I get TypeError: class members are not yet supported: _missing_, name, value, _convert, _member_names_, _member_map_, _member_type_, _value2member_map_, A, B
When I just try to compile without a spec, like below :
from numba import jitclass
from enum import Enum
@jitclass
class Type(Enum):
A = 'A'
B = 'B'
I get an AttributeError: items when I call the constructor. I just can't seem to find the right syntax to turn my Enum class into a jitclass. How can I achieve this?