unitelabs.labware.liquids.mixture
Attributes
- Name
Number
- Type
- Value
= typing.Union[str, int, float, tuple[int, collections.abc.Sequence[int], int], decimal.Decimal]
- Description
Functions
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
Mixture
Combination of liquids mixed together.
- Bases
- collections.abc.MutableSequence[Ingredient]
Methods
__init__(self, ingredients : typing.Optional[collections.abc.Iterable[Ingredient]]) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
ingredients
- Type
- typing.Optional[collections.abc.Iterable[Ingredient]]
- Default
- = None
- Description
__len__(self) -> int
Return len(self).
Response
- Type
- int
- Description
__getitem__(self, index : typing.Union[typing.SupportsIndex, slice]) -> typing.Union[Ingredient, list[Ingredient]]
x.__getitem__(y) <==> x[y]
Parameters
- Name
self
- Type
- Default
- Description
- Name
index
- Type
- typing.Union[typing.SupportsIndex, slice]
- Default
- Description
Response
- Type
- typing.Union[Ingredient, list[Ingredient]]
- Description
__setitem__(self, index : typing.Union[typing.SupportsIndex, slice], value : typing.Union[Ingredient, collections.abc.Iterable[Ingredient]]) -> None
Set self[key] to value.
Parameters
- Name
self
- Type
- Default
- Description
- Name
index
- Type
- typing.Union[typing.SupportsIndex, slice]
- Default
- Description
- Name
value
- Type
- typing.Union[Ingredient, collections.abc.Iterable[Ingredient]]
- Default
- Description
__delitem__(self, index : typing.Union[typing.SupportsIndex, slice]) -> None
Delete self[key].
Parameters
- Name
self
- Type
- Default
- Description
- Name
index
- Type
- typing.Union[typing.SupportsIndex, slice]
- Default
- Description
__iter__(self) -> collections.abc.Iterator[Ingredient]
Implement iter(self).
Response
- Type
- collections.abc.Iterator[Ingredient]
- Description
__reversed__(self) -> collections.abc.Iterator[Ingredient]
Return a reverse iterator over the list.
Response
- Type
- collections.abc.Iterator[Ingredient]
- Description
__add__(self, other : typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]) -> Mixture
Return self+other.
Parameters
- Name
self
- Type
- Default
- Description
- Name
other
- Type
- typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]
- Default
- Description
Response
- Type
- Mixture
- Description
__radd__(self, other : typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]) -> Mixture
Return other+self.
Parameters
- Name
self
- Type
- Default
- Description
- Name
other
- Type
- typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]
- Default
- Description
Response
- Type
- Mixture
- Description
__iadd__(self, other : typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]) -> Mixture
Implement self+=value.
Parameters
- Name
self
- Type
- Default
- Description
- Name
other
- Type
- typing.Union[Mixture, collections.abc.Iterable[Ingredient], Ingredient]
- Default
- Description
Response
- Type
- Mixture
- Description
__str__(self) -> None
Return str(self).
__repr__(self) -> None
Return repr(self).
__eq__(self, value : typing.Union[Mixture, collections.abc.Iterable[Ingredient]]) -> bool
Return self==value.
Parameters
- Name
self
- Type
- Default
- Description
- Name
value
- Type
- typing.Union[Mixture, collections.abc.Iterable[Ingredient]]
- Default
- Description
Response
- Type
- bool
- Description
@log()
append(self, value : Ingredient) -> NoneAppend object to the end of the list.
Parameters
- Name
self
- Type
- Default
- Description
- Name
value
- Type
- Ingredient
- Default
- Description
@log()
extend(self, values : typing.Union[Mixture, collections.abc.Iterable[Ingredient]]) -> NoneExtend list by appending elements from the iterable.
Parameters
- Name
self
- Type
- Default
- Description
- Name
values
- Type
- typing.Union[Mixture, collections.abc.Iterable[Ingredient]]
- Default
- Description
@log()
insert(self, index : typing.SupportsIndex, value : Ingredient) -> NoneInsert value before index.
Parameters
- Name
self
- Type
- Default
- Description
- Name
index
- Type
- typing.SupportsIndex
- Default
- Description
- Name
value
- Type
- Ingredient
- Default
- Description
@log()
pop(self, index : typing.SupportsIndex) -> IngredientRemove and return item at index (default last).
Parameters
- Name
self
- Type
- Default
- Description
- Name
index
- Type
- typing.SupportsIndex
- Default
- Description
Response
- Type
- Ingredient
- Description
Exceptions
- Type
- IndexError
- Description
- if list is empty or index is out of range.
@log()
remove(self, volume : Number) -> MixtureRemove volume proportionally from mixture.
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Number
- Default
- Description
The volume of liquid in µl to remove.
Response
- Type
- Mixture
- Description
The removed mixture of liquid.
Exceptions
- Type
- ValueError
- Description
- If the volume to remove exceeds the current volume.
@log()
clear(self) -> NoneRemove all items from the mixture.
index(self, value : typing.Union[Liquid, Sample], start : typing.SupportsIndex, stop : typing.SupportsIndex) -> int
Return first index of value.
Parameters
- Name
self
- Type
- Default
- Description
- Name
start
- Type
- typing.SupportsIndex
- Default
- = 0
- Description
- Name
stop
- Type
- typing.SupportsIndex
- Default
- = sys.maxsize
- Description
Response
- Type
- int
- Description
Exceptions
- Type
- ValueError
- Description
- if the value is not present.
reverse(self) -> None
Reverse sequence in place.
Attributes
- Name
_ingredients
- Type
- list[Ingredient]
- Value
= list(ingredients) if ingredients is not None else []
- Description
- Name
_volume
- Type
- decimal.Decimal
- Value
= sum(v.amount for v in self._ingredients, start=decimal.Decimal(0))
- Description
- Name
logger
- Type
- logging.Logger
- Value
= None
- Description
- Name
volume
- Type
- decimal.Decimal
- Value
= None
- Description
The current volume in µl of liquid in this mixture.
- Name
ingredients
- Type
- list[Ingredient]
- Value
= None
- Description
The current ingredients in this mixture.