hvl_ccb.utils.enum
digraph inheritance2564981f66 { bgcolor=transparent; rankdir=TB; size=""; "AutoNumberEnum" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Automatically assign increasing values to members."]; "Enum" -> "AutoNumberEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "AutoNumberNameEnum" [URL="../hvl_ccb.utils.enum.html#hvl_ccb.utils.enum.AutoNumberNameEnum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Auto-numbered enum with names used as string representation, and with lookup and"]; "NameEnum" -> "AutoNumberNameEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "AutoNumberEnum" -> "AutoNumberNameEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BoolEnum" [URL="../hvl_ccb.utils.enum.html#hvl_ccb.utils.enum.BoolEnum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="BoolEnum inherits from NameEnum and the type of the first value is"]; "NameEnum" -> "BoolEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Enum" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="An enumeration."]; "NameEnum" [URL="../hvl_ccb.utils.enum.html#hvl_ccb.utils.enum.NameEnum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Enum with names used as string representation, and with lookup and equality based on"]; "StrEnumBase" -> "NameEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RangeEnum" [URL="../hvl_ccb.utils.enum.html#hvl_ccb.utils.enum.RangeEnum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Range enumeration inherit from ValueEnum, find suitable voltage/current/resistance"]; "ValueEnum" -> "RangeEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; "StrEnumBase" [URL="../hvl_ccb.utils.enum.html#hvl_ccb.utils.enum.StrEnumBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="String representation-based equality and lookup."]; "Enum" -> "StrEnumBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueEnum" [URL="../hvl_ccb.utils.enum.html#hvl_ccb.utils.enum.ValueEnum",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Enum with string representation of values used as string representation, and with"]; "StrEnumBase" -> "ValueEnum" [arrowsize=0.5,style="setlinewidth(0.5)"]; }- class AutoNumberNameEnum(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
NameEnum
,AutoNumberEnum
Auto-numbered enum with names used as string representation, and with lookup and equality based on this representation.
- class BoolEnum(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
NameEnum
- BoolEnum inherits from NameEnum and the type of the first value is
enforced to be ‘boolean’. For bool()-operation the __bool__ is redefined here.
- class NameEnum(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnumBase
Enum with names used as string representation, and with lookup and equality based on this representation. The lookup is implemented in StrEnumBase with the _missing_value_ method. The equality is also defined at this place (__eq__).
Use-case:
class E(NameEnum): a = 2 b = 4 E.a == "a" E.a != 2 E.a != "2"
The access would be normally with E[“a”], but E(“a”) works also. Therefore, E[“a”] == E(“a”)
Attention: to avoid errors, best use together with unique enum decorator.
- class RangeEnum(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
float
,ValueEnum
Range enumeration inherit from ValueEnum, find suitable voltage/current/resistance input range for devices such as multimeter and oscilloscope
- class StrEnumBase(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
String representation-based equality and lookup.
- class ValueEnum(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StrEnumBase
Enum with string representation of values used as string representation, and with lookup and equality based on this representation. Values do not need to be of type ‘str’, but they need to have a str-representation to enable this feature. The lookup is implemented in StrEnumBase with the _missing_value_ method. The equality is also defined at this place (__eq__).
Use-case:
class E(ValueEnum): ONE = 1 E.ONE == "1" E.ONE != 1 E.ONE != "ONE"
The access would be normally with E(1), but E(“1”) works also. Therefore, E(1) == E(“1”)
Attention: to avoid errors, best use together with unique enum decorator.