robotools.liquidhandling#
Object-oriented, stateful labware representations.
- class robotools.liquidhandling.labware.Labware(name: str, rows: int, columns: int, *, min_volume: float, max_volume: float, initial_volumes: float | ndarray | None = None, virtual_rows: int | None = None, component_names: Mapping[str, str | None] | None = None)#
Bases:
object
Represents an array of liquid cavities.
- Attributes:
composition
Relative composition of the liquids.
history
List of label/volumes history.
indices
Mapping of well-ids to numpy indices.
- is_trough
- n_columns
- n_rows
positions
Mapping of well-ids to EVOware-compatible position numbers.
report
A printable report of the labware history.
shape
Number of rows and columns.
volumes
Current volumes in the labware.
wells
Array of well ids.
Methods
add
(wells, volumes[, label, compositions])Adds volumes to wells.
condense_log
(n[, label])Condense the last n log entries.
get_well_composition
(well)Retrieves the relative composition of a well.
log
(label)Logs the current volumes to the history.
remove
(wells, volumes[, label])Removes volumes from wells.
- add(wells: str | Sequence[str] | ndarray, volumes: float | Sequence[float] | ndarray, label: str | None = None, compositions: Sequence[Mapping[str, float] | None] | None = None) None #
Adds volumes to wells.
- Parameters:
- wellsiterable of str
Well ids
- volumesfloat, iterable of float
Scalar or iterable of volumes
- labelstr
Description of the operation
- compositionsiterable
List of composition dictionaries ({ name : relative amount })
- property composition: Dict[str, ndarray]#
Relative composition of the liquids.
This dictionary maps liquid names (keys) to arrays of relative amounts in each well.
- condense_log(n: int, label: str | None = 'last') None #
Condense the last n log entries.
- Parameters:
- nint
Number of log entries to condense
- labelstr
‘first’, ‘last’ or label of the condensed entry (default: label of the last entry in the condensate)
- get_well_composition(well: str) Dict[str, float] #
Retrieves the relative composition of a well.
- Parameters:
- wellstr
ID of the well for which to retrieve the composition.
- Returns:
- compositiondict
Keys: liquid names Values: relative amount
- property history: List[Tuple[str | None, ndarray]]#
List of label/volumes history.
- property indices: Dict[str, Tuple[int, int]]#
Mapping of well-ids to numpy indices.
- property is_trough: bool#
- log(label: str | None) None #
Logs the current volumes to the history.
- Parameters:
- labelstr
A label to insert in the history.
- property n_columns: int#
- property n_rows: int#
- property positions: Dict[str, int]#
Mapping of well-ids to EVOware-compatible position numbers.
- remove(wells: str | Sequence[str] | ndarray, volumes: float | Sequence[float] | ndarray, label: str | None = None) None #
Removes volumes from wells.
- Parameters:
- wellsiterable of str
Well ids
- volumesfloat, iterable of float
Scalar or iterable of volumes
- labelstr
Description of the operation
- property report: str#
A printable report of the labware history.
- property shape: Tuple[int, int]#
Number of rows and columns.
- property volumes: ndarray#
Current volumes in the labware.
- property wells: ndarray#
Array of well ids.
- class robotools.liquidhandling.labware.Trough(name: str, virtual_rows: int, columns: int, *, min_volume: float, max_volume: float, initial_volumes: float | Sequence[float] | ndarray = 0, column_names: Sequence[str | None] | None = None)#
Bases:
Labware
Special type of labware that can be accessed by many pipette tips in parallel.
- Attributes:
composition
Relative composition of the liquids.
history
List of label/volumes history.
indices
Mapping of well-ids to numpy indices.
- is_trough
- n_columns
- n_rows
positions
Mapping of well-ids to EVOware-compatible position numbers.
report
A printable report of the labware history.
shape
Number of rows and columns.
volumes
Current volumes in the labware.
wells
Array of well ids.
Methods
add
(wells, volumes[, label, compositions])Adds volumes to wells.
condense_log
(n[, label])Condense the last n log entries.
get_well_composition
(well)Retrieves the relative composition of a well.
log
(label)Logs the current volumes to the history.
remove
(wells, volumes[, label])Removes volumes from wells.
Exceptions that indicate problems in liquid handling.
- exception robotools.liquidhandling.exceptions.VolumeOverflowError(labware: str, well: str, current: float, change: float, threshold: float, label: str | None = None)#
Bases:
VolumeViolationException
Error that indicates the planned overflow of a well.
- exception robotools.liquidhandling.exceptions.VolumeUnderflowError(labware: str, well: str, current: float, change: float, threshold: float, label: str | None = None)#
Bases:
VolumeViolationException
Error that indicates the planned underflow of a well.
- exception robotools.liquidhandling.exceptions.VolumeViolationException#
Bases:
Exception
Error indicating a violation of volume constraints.