8.4.6. pymodaq_utils.enums module

class pymodaq_utils.enums.BaseEnum(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enum to be used within pymodaq with some utility methods

classmethod names()[source]

Returns all the names of the enum

Return type:

List[str]

classmethod to_dict()[source]

Returns the enum in form of a dict with names os keys

New in 4.0.2

classmethod to_dict_value()[source]

Returns the enum in form of a dict with values os keys

New in 4.0.2

classmethod values()[source]

Returns all the names of the enum

Return type:

List[str]

class pymodaq_utils.enums.StrEnum(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

classmethod names()[source]

Returns all the names of the enum

Return type:

List[str]

classmethod values()[source]

Returns all the names of the enum

Return type:

List[str]

pymodaq_utils.enums.enum_checker(enum, item)[source]

Check if the item parameter is a valid enum or at least one valid string name of the enum

If a string, transforms it to a valid enum (case not important)

Parameters:
Return type:

BaseEnum class or one of its derivated class