unitelabs.labware.utils
Packages
Attributes
- Name
MaybeList- Type
- Value
= typing.Union[Item, collections.abc.Sequence[Item]]
- Description
- Name
__all__- Type
- Value
= [ "find_subclass", "get_index_for_label", "MaybeList", "get", "extend", "expand", "pairwise", "get_default_for_field", "Level", "log", "LabwareEncoder" ]
- Description
Functions
get_default_for_field(field : dataclasses.Field) -> typing.Any
Get the default value of a dataclass field.
Parameters
- Name
field- Type
- dataclasses.Field
- Default
- Description
Response
- Type
- typing.Any
- Description
get_index_for_label(label : str, cols : int, rows : int) -> int
Parameters
- Name
label- Type
- str
- Default
- Description
- Name
cols- Type
- int
- Default
- Description
- Name
rows- Type
- int
- Default
- Description
Response
- Type
- int
- Description
get(list_or_item : MaybeList[Item], index : typing.SupportsIndex) -> typing.Union[CharSequence, Item]
Parameters
- Name
index- Type
- typing.SupportsIndex
- Default
- Description
Response
- Type
- typing.Union[CharSequence, Item]
- Description
expand(list_or_item : MaybeList[Item], count : int) -> collections.abc.Iterable[typing.Union[CharSequence, Item]]
Uses the given sequence or repeats a single value a specified number of times.
Parameters
- Name
count- Type
- int
- Default
- Description
The number of times the single value should be repeated.
Response
- Type
- collections.abc.Iterable[typing.Union[CharSequence, Item]]
- Description
A list with the specified number of values.
log(level : typing.Union[typing.Literal['CRITICAL', 'FATAL', 'ERROR', 'WARN', 'WARNING', 'INFO', 'DEBUG'], Level]) -> None
Log the method execution of a class with the provided arguments.
Parameters
Classes
LabwareEncoder
- Bases
- json.JSONEncoder
Methods
default(self, o) -> None
Parameters
- Name
self- Type
- Default
- Description
- Name
o- Type
- Default
- Description
Level
- Bases
- enum.IntEnum
Attributes
- Name
CRITICAL- Type
- Value
= logging.CRITICAL
- Description
- Name
FATAL- Type
- Value
= logging.CRITICAL
- Description
- Name
ERROR- Type
- Value
= logging.ERROR
- Description
- Name
WARN- Type
- Value
= logging.WARNING
- Description
- Name
WARNING- Type
- Value
= logging.WARNING
- Description
- Name
INFO- Type
- Value
= logging.INFO
- Description
- Name
DEBUG- Type
- Value
= logging.DEBUG
- Description
- Name
NOTSET- Type
- Value
= logging.NOTSET
- Description