ListEnum

class ListEnum(value)[source]

Bases: enum.Enum

List Enum (enum with function listing names and values)

>>> @unique
>>> class TsxPolarization(ListEnum):
>>>     SINGLE = "S"  # Single
>>>     DUAL = "D"  # Dual
>>>     QUAD = "Q"  # Quad
>>>     TWIN = "T"  # Twin

Methods

list_values()

Get the value list of this enum

list_names()

Get the name list of this enum:

from_value(val)

Get the enum class from its value:

convert_from(to_convert)

Convert from a list or a string to an enum instance

classmethod convert_from(to_convert: Union[list, str]) list[source]

Convert from a list or a string to an enum instance

>>> TsxPolarization.convert_from(["SINGLE", "S", TsxPolarization.QUAD])
[<TsxPolarization.SINGLE: 'S'>, <TsxPolarization.SINGLE: 'S'>, <TsxPolarization.QUAD: 'Q'>]
Parameters

to_convert (Union[list, str]) – List or string to convert into an enum instance

Returns

Converted list

Return type

list

classmethod from_value(val: Any) sertit.misc.ListEnum[source]

Get the enum class from its value:

>>> TsxPolarization.from_value("Q")
<TsxPolarization.QUAD: 'Q'>
Parameters

val (Any) – Value of the Enum

Returns

Enum with value

Return type

ListEnum

classmethod list_names() list[source]

Get the name list of this enum:

>>> TsxPolarization.list_values()
["SINGLE", "DUAL", "QUAD", "TWIN"]
classmethod list_values() list[source]

Get the value list of this enum

>>> TsxPolarization.list_values()
["S", "D", "Q", "T"]