unitelabs.labware
unitelabs/labware/__init__.py
Packages
Attributes
- __all__= [ "unitelabs.labware.utils.missing.MISSING", "unitelabs.labware.pipettable.pipettable.AccessGrid", "unitelabs.labware.pipettable.pipettable.AccessPoint", "unitelabs.labware.groups.adapter.Adapter", "unitelabs.labware.math.placement.Alignment", "unitelabs.labware.tubes.cap.Cap", "unitelabs.labware.carriers.carrier.Carrier", "unitelabs.labware.carriers.carrier_site.CarrierSite", "unitelabs.labware.resource.schema.ChildrenField", "unitelabs.labware.math.shapes.ComplexShape", "unitelabs.labware.math.shapes.Cone", "unitelabs.labware.math.shapes.ConicalFrustum", "unitelabs.labware.liquids.container.Container", "unitelabs.labware.math.shapes.Cuboid", "unitelabs.labware.math.shapes.Cylinder", "unitelabs.labware.math.decimal.Decimal", "unitelabs.labware.math.decimal.DecimalField", "unitelabs.labware.groups.deck.Deck", "unitelabs.labware.math.placement.Direction", "unitelabs.labware.liquids.fillable.Fillable", "unitelabs.labware.groups.group.Group", "unitelabs.labware.math.shapes.HalfSphere", "unitelabs.labware.liquids.hole.Hole", "unitelabs.labware.resource.instrument.Instrument", "unitelabs.labware.resource.schema.JsonSchema", "unitelabs.labware.resource.labware.Labware", "unitelabs.labware.utils.json.LabwareEncoder", "unitelabs.labware.utils.logging.Level", "unitelabs.labware.plates.lid.Lid", "unitelabs.labware.liquids.liquid.Liquid", "unitelabs.labware.liquids.liquid_class.LiquidClass", "unitelabs.labware.liquids.liquid_overflow_error.LiquidOverflowError", "unitelabs.labware.liquids.liquid_underflow_error.LiquidUnderflowError", "unitelabs.labware.utils.list.MaybeList", "unitelabs.labware.resource.missing_error.MissingError", "unitelabs.labware.utils.missing.MissingType", "unitelabs.labware.liquids.mixture.Mixture", "unitelabs.labware.liquids.mixture.MixtureField", "unitelabs.labware.math.decimal.Number", "unitelabs.labware.resource.occupied_error.OccupiedError", "unitelabs.labware.carriers.orientation.Orientation", "unitelabs.labware.pipettable.pipettable.Pipettable", "unitelabs.labware.pipettable.pipettable.PipettableTarget", "unitelabs.labware.plates.plate.Plate", "unitelabs.labware.math.shapes.Pyramid", "unitelabs.labware.math.shapes.PyramidalFrustum", "unitelabs.labware.groups.rack.Rack", "unitelabs.labware.resource.resource.Resource", "unitelabs.labware.resource.schema.ResourceSchema", "unitelabs.labware.liquids.sample.Sample", "unitelabs.labware.utils.serializable.Serializable", "unitelabs.labware.math.shapes.Shape", "unitelabs.labware.math.shapes.SphericalCap", "unitelabs.labware.math.shapes.SphericalSegment", "unitelabs.labware.groups.spot.Spot", "unitelabs.labware.groups.stack.Stack", "unitelabs.labware.math.shapes.Stacked", "unitelabs.labware.plates.standard_plates.Standard96Plate", "unitelabs.labware.plates.standard_plates.Standard384Plate", "unitelabs.labware.plates.standard_plates.Standard1536Plate", "unitelabs.labware.dimensions.ansi_slas.StandardMicroplateDimensions", "unitelabs.labware.troughs.standard_trough.StandardTrough", "unitelabs.labware.troughs.complex_troughs.StandardTrough8Row", "unitelabs.labware.troughs.complex_troughs.StandardTrough12Column", "unitelabs.labware.tubes.tube_rack.StandardTubeRack", "unitelabs.labware.tips.tip.Tip", "unitelabs.labware.tips.tip_rack.TipRack", "unitelabs.labware.tips.tip_spot.TipSpot", "unitelabs.labware.groups.trash.Trash", "unitelabs.labware.troughs.trough.Trough", "unitelabs.labware.tubes.tube.Tube", "unitelabs.labware.tubes.tube_rack.TubeRack", "unitelabs.labware.tubes.tube_spot.TubeSpot", "unitelabs.labware.groups.unassigned_error.UnassignedError", "unitelabs.labware.math.vector.Vector", "unitelabs.labware.plates.well.Well", "unitelabs.labware.math.units.c_to_100c", "unitelabs.labware.utils.list.expand", "unitelabs.labware.utils.list.extend", "unitelabs.labware.utils.find_subclass", "unitelabs.labware.utils.list.get", "unitelabs.labware.utils.dataclasses.get_default_for_field", "unitelabs.labware.utils.label_index.get_index_for_label", "unitelabs.labware.utils.hole_positions.hole_positions_from_children", "unitelabs.labware.utils.hole_positions.hole_positions_from_holes", "unitelabs.labware.math.decimal.is_number", "unitelabs.labware.utils.logging.log", "unitelabs.labware.math.units.mm_to_100um", "unitelabs.labware.math.decimal.parse_number", "unitelabs.labware.math.placement.place", "unitelabs.labware.math.placement.place_standardized", "unitelabs.labware.math.units.to_c", "unitelabs.labware.math.units.to_mm", "unitelabs.labware.math.units.to_ul", "unitelabs.labware.math.units.ul_to_100nl" ]
Classes
Carrier
classCarriers hold and position labware such as plates, tubes and tips for easy and precise access by liquid handlers. They consist of readonly sites, on which labware can be placed.
Methods
__init__(- self,
- tags : dict,
- children : collections.abc.Sequence[S],
- filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None]
CarrierSite
classOptionally hold labware at a predefined location on a carrier.
Methods
__init__(- self,
- children : collections.abc.Sequence[T],
- orientation : Orientation
childrencollections.abc.Sequence[T]orientation
Attributes
- orientationOrientation = Orientation.LANDSCAPE
Orientation
classThe carrier site orientation.
- Bases
- str, enum.Enum
Attributes
- LANDSCAPE= 'LANDSCAPE'
- PORTRAIT= 'PORTRAIT'
StandardMicroplateDimensions
classANSI/SLAS microplate bounding box dimension to accommodate other labware, with its original z-height. When using this class, only the z-height of the labware should be specified in `dimensions`. If x or y are specified, they will be reset to the standard ANSI/SLAS footprint dimensions (127.76 mm x 85.48 mm). If z is NOT specified, it will be reset to the standard ANSI/SLAS height (14.35 mm). ```python class SomeLabware(SomeLabwareType, StandardMicroplateDimensions): dimensions = Vector(z=28.55) ```
- Decorators
- dataclasses.dataclass
Methods
__init__(self, tags : dict) -> Nonetagsdict__post_init__(self, *args, **kwargs) -> None*args= ()**kwargs= {}
Adapter
classHold a single labware such as a plate or a tube for easy and precise access by liquid handlers. Consists of exactly one read-only spot, on which labware can be placed.
Methods
@log()
clear(self) -> NoneClear the adapter by removing any labware assigned to it.
__delitem__(self, key : typing_extensions.Literal[0, '0']) -> NoneUnassign the child from the adapter at the given key. Implemented to conserve the interface compared to `Rack`.
keytyping_extensions.Literal[0, '0']The key where to unassign the child from.
Attributes
- childrencollections.abc.Sequence[S] = dataclasses.field(init=False, repr=False, default_factory=list)
Deck
classThe deck is the area in which labware is arranged for usage by the liquid handling system.
Methods
@log()
clear(self) -> NoneRemove all labware from this deck.
summary(self) -> strSummarize the main resources of the current deck layout.
strThe deck layout summary.Verify whether the given resource can be assigned to this deck.
typing.TypeGuard[T]True if the resource can be assigned, otherwise raise an error.Assign the given resource to this deck.
Verify whether the given resource can be unassigned from this deck.
resourceThe resource to unassign from this deck.**kwargs= {}Additional arguments for the deck.typing.TypeGuard[T]True if the resource can be unassigned, otherwise raise an error.to_json(self) -> dict[str, typing.Any]Return deck configuration as dictionary.
dict[str, typing.Any]The deck configuration as a JSON-compatible dictionary.@classmethod
from_json(cls, deck_dict : dict[str, typing.Any]) -> typing.SelfLoad deck configuration from dictionary.
deck_dictdict[str, typing.Any]The JSON-compatible dictionary containing deck configuration.typing.SelfThe newly created deck instance._rebuild_index(self) -> NoneFor Subclasses to rebuild their internal position index after deserialization.
_restore_parent_refs_and_index(self, loaded : typing.Self) -> NoneRestore parent references and rebuild the index after in-place deserialization.
loadedtyping.SelfThe newly deserialized deck instance to copy state from.save(self, file_path : str | pathlib.Path) -> NoneSave deck configuration to JSON file.
file_pathstr | pathlib.PathThe path where to save the deck configuration.@classmethod
load(cls, file_path : str | pathlib.Path) -> typing.SelfLoad deck configuration from JSON file.
file_pathstr | pathlib.PathThe path to the JSON file containing deck configuration.typing.SelfThe newly created deck instance.
Attributes
- loggerlogging.Logger = NoneThe logger for this deck.
Group
classA resource with the ability to hold or combine other resources.
Methods
__post_init__(self, *kwargs) -> None*kwargs= ()__init_subclass__(cls) -> None@typing.override
rotate_by(self, angle : int) -> Noneangleint__contains__(self, item : object) -> boolitemobjectbool__len__(self) -> intGet the number of children in this group.
intThe number of children in this group._index(self, key : int | str | slice) -> int | slicekeyint | str | sliceint | slicecopy(self, **changes) -> typing.SelfCopy this group.
**changes= {}Additional arguments for the group.typing.SelfThe copied group.
Attributes
- childrencollections.abc.Sequence[T] = dataclasses.field(metadata={'marshmallow_field': marshmallow.fields.List(ChildrenField(Resource.Schema(), 'identifier'))}, repr=False, default_factory=list)
Rack
classA framework for holding or storing labware in pre-defined spots.
Methods
__init__(- self,
- children : collections.abc.Sequence[S],
- filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None]
__delitem__(self, key : int | str | slice) -> Nonekeyint | str | sliceserialize(self) -> JsonSchemaSerialize rack, flattening spots to directly serialize their children.
The serialized rack configuration.@classmethod
deserialize(cls, identifier : str, schema : JsonSchema) -> typing.SelfDeserialize rack, reconstructing spots from flattened children.
identifierstrThe identifier of the rack to deserialize.schemaThe JSON schema containing the rack data.typing.SelfThe newly created rack instance.
Attributes
- childrencollections.abc.Sequence[S] = dataclasses.field(repr=False, default_factory=list)
- loggerlogging.Logger = NoneThe logger for this rack.
Spot
classOptionally holds one item of a certain labware type.
Methods
Unassign the given resource from this group and assign it another one.
Attributes
- childrencollections.abc.Sequence[T | None] = dataclasses.field(init=False, repr=False, default_factory=(lambda: [None]))
- well_labelstr = NoneGet well label for this spot based on its position in parent (e.g., 'A1', 'B2').
- childT | None = NoneRequest the resource in this spot or `None` if the spot is empty.
Stack
classBase class for groups of resources that are stacked together and act as a single unit.
Methods
Verify whether the given resource can be assigned to this stack.
typing.TypeGuard[T]True if the resource can be assigned, otherwise raise an error.Assign the given resource to this group.
Attributes
- directiontyping.Literal['x', 'y', 'z'] = 'z'
- widthdecimal.Decimal = None
- depthdecimal.Decimal = None
- heightdecimal.Decimal = None
Trash
classTrash area.
UnassignedError
classRaised when a resource is not assigned to a specific group.
- Bases
- RuntimeError
Container
classHold and manage liquids in a container.
Methods
__post_init__(self) -> NoneAdd a certain volume of liquid into this container.
@log()
add_liquids(- self,
- is_estimate : bool
Add a mixture of liquids into this container.
A sequence of tuples containing the liquid and volume to add.is_estimatebool = FalseWhether the volume is an estimate. If any component volumes are estimated, the entire mixture volume must also be considered to be estimated. Defaults to False.can_remove_liquid(self, volume : Number, strict : bool) -> decimal.DecimalCheck if a certain volume of liquid can be removed from this container.
volumeThe volume of liquid in µl to remove.strictbool = TrueWhether to raise if volume cannot be removed. Defaults to True.decimal.DecimalThe volume of liquid in µl that can be removed from this container.
Attributes
- max_volumeDecimal = dataclasses.field(default=(Decimal()))
- liquidsMixture = dataclasses.field(metadata={'marshmallow_field': MixtureField()}, default_factory=Mixture)
- _liquid_level= Decimal()
- _volume_is_estimatebool = dataclasses.field(default=False, init=False, repr=False, metadata={'marshmallow_field': marshmallow.fields.Boolean(data_key='volume_is_estimate')})
- loggerlogging.Logger = NoneThe logger for this container.
- volumedecimal.Decimal = NoneThe current volume in µl of liquid filling the container.
- free_volumedecimal.Decimal = NoneThe freely available volume in µl in the container.
- liquid_leveldecimal.Decimal = NoneThe height of the liquid in the container, in mm.
Fillable
classAny resource that can be filled with liquids.
Methods
Attributes
Hole
classA hole in a container.
Liquid
classA substance used in liquid handling. Predefined liquids are accessed via the LiquidsDatabase: from unitelabs.labware.liquids import Liquids mixture.add(Liquids.WATER, 100) Ad-hoc liquids with optional physical metadata are created directly: buffer = Liquid("Tris buffer", viscosity=1.0, density=1.02) mixture.add(buffer, 50) Two ``Liquid`` instances are equal when their ``name``, ``viscosity``, and ``density`` fields match. The ``identifier`` is excluded from equality so that homogenization works by substance identity, not by instance identity. Creating a ``Liquid`` whose name collides with a predefined liquid or alias in the ``LiquidsDatabase`` is forbidden — use the predefined constant instead (e.g. ``Liquids.WATER``). Custom aliases can be added for predefined liquids to support lab-specific naming conventions: Liquids.add_alias(Liquids.WATER, "Aqua") mixture.add("Aqua", 100) # Works like Liquids.WATER
- Decorators
- dataclasses.dataclass(frozen=True)
Methods
__init__(- self,
- name : str,
- viscosity : float | None,
- density : float | None,
- identifier : str
namestrviscosityfloat | None = Nonedensityfloat | None = Noneidentifierstr__new__(- cls,
- name : str,
- viscosity : float | None,
- density : float | None,
- identifier : str | None
Create a new Liquid instance.
namestrThe name of the liquid.viscosityfloat | None = NoneThe viscosity of the liquid, if known.densityfloat | None = NoneThe density of the liquid, if known.identifierstr | None = NoneThe unique identifier of the liquid, if known.__hash__(self) -> intint__str__(self) -> strstr__repr__(self) -> strstr
Attributes
- namestr = None
- viscosityfloat | None = None
- densityfloat | None = None
- identifierstr = dataclasses.field(default_factory=(lambda: str(uuid.uuid4().hex[:8])), compare=False)
LiquidClass
classLiquid classes are global definitions for a liquid that can be used in any method. The liquid class provides detailed instructions for how a channel's plunger should manipulate a liquid. A liquid class needs to be selected for each aspiration and dispense step in a method, and that liquid class needs to match the tip type and mode. This means that the liquid class needs to be defined in detail ahead of time before the method can be built.
Methods
__str__(self) -> strstr
Attributes
LiquidOverflowError
classRaised when a container is too full to add the specified volume of liquid.
- Bases
- Exception
LiquidUnderflowError
classRaised when a container is too empty to remove the specified volume of liquid.
- Bases
- Exception
Mixture
classCombination of liquids mixed together.
- MRO
- └ Mixture
- Decorators
- dataclasses.dataclass()
Methods
@typing.override
__len__(self) -> intint@typing.override
__contains__(self, x : object) -> boolxobjectbool@typing.override
values(self) -> collections.abc.Sequence[decimal.Decimal]collections.abc.Sequence[decimal.Decimal]@typing.override
clear(self) -> None@typing.override
__str__(self) -> None@typing.override
__repr__(self) -> None@typing.override
__eq__(self, other : object) -> boolotherobjectbool@typing.override
__hash__(self) -> intint@typing.override
serialize(self) -> dict[str, str]dict[str, str]@typing.override
@classmethod
deserialize(cls, value : dict[str, str]) -> typing.Selfvaluedict[str, str]typing.Self
Attributes
- ingredientsdict[str, decimal.Decimal] = {}
- _volume= decimal.Decimal(0)
- loggerlogging.Logger = NoneThe logger for this mixture.
- volumedecimal.Decimal = NoneThe total volume of the mixture.
MixtureField
classMixture field for marshmallow.
- Bases
- marshmallow.fields.Field
Methods
@typing.override
_serialize(- self,
- value : typing.Any,
- attr : str | None,
- obj : typing.Any,
- **kwargs
valuetyping.Anyattrstr | Noneobjtyping.Any**kwargs= {}typing.Any@typing.override
_deserialize(- self,
- value : typing.Any,
- attr : str | None,
- data : typing.Mapping[str, typing.Any] | None,
- **kwargs
valuetyping.Anyattrstr | Nonedatatyping.Mapping[str, typing.Any] | None**kwargs= {}typing.Any
Sample
classTraceable sample used in liquid handling.
- Decorators
- dataclasses.dataclass
Methods
__init__(self, name : str, identifier : str) -> Nonenamestridentifierstr__post_init__(self) -> None__str__(self) -> strstr__hash__(self) -> intint
Attributes
- namestr = None
- identifierstr = dataclasses.field(default_factory=(lambda: str(uuid.uuid4().hex[:8])))
Alignment
classDefines the alignment and distribution of items along an axis.
- Bases
- enum.Enum
Attributes
- START= enum.auto()Items are packed toward the start of the direction.
- END= enum.auto()Items are packed toward the end of the direction.
- CENTER= enum.auto()Items are centered along the direction.
- SPACE_BETWEEN= enum.auto()Items are evenly distributed in the direction; first item is on the start line, last item on the end line.
- SPACE_AROUND= enum.auto()Items are evenly distributed in the direction with equal space around them.
- SPACE_EVENLY= enum.auto()Items are distributed so that the spacing between any two items (and the space to the edges) is equal.
ComplexShape
classA shape with with complex dimensions that can be filled with liquid.
- MRO
- Decorators
- dataclasses.dataclass
Methods
Attributes
- factorDecimal = dataclasses.field(default=(Decimal()))
- max_fitting_volumedecimal.Decimal = NoneThe maximum volume that fits into this shape.
Cone
classA solid shape with a circular base shape, that narrows smoothly from the base to a point at a certain height. The apex is at the bottom (height=0) and the circular base is at the top (height=self.height).
ConicalFrustum
classA solid shape with 3 faces. A conical frustum is the lower portion or base of a cone that is a result of cutting off the upper portion by a plane parallel to the base of the shape. See: https://math.stackexchange.com/questions/234upper534/relation-between-height-and-volume-of-frustum.
- MRO
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
Attributes
Cuboid
classA six-faced solid shape with a rectangular base shape and a certain height.
Methods
__post_init__(self) -> None
Attributes
Cylinder
classA solid shape with two parallel circular base shapes joined by a curved surface with a certain height.
Decimal
classDecimal number for fast correctly rounded decimal floating point arithmetic.
- Bases
- decimal.Decimal
Methods
__set_name__(self, owner : type[object], name : str) -> Noneownertype[object]namestr__get__(self, instance : object | None, owner : type[object] | None) -> decimal.Decimalinstanceobject | Noneownertype[object] | Nonedecimal.Decimal@classmethod
__get_pydantic_core_schema__(- cls,
- source_type : typing.Any,
- handler : pydantic.GetCoreSchemaHandler
source_typetyping.Anyhandlerpydantic.GetCoreSchemaHandlerpydantic_core.core_schema.CoreSchema
Attributes
- _default_value= parse_number(default)
- _attr_name= ''
DecimalField
classDecimal field for marshmallow.
- Bases
- marshmallow.fields.Field
Methods
_serialize(- self,
- value : typing.Any,
- attr : str | None,
- obj : typing.Any,
- **kwargs
valuetyping.Anyattrstr | Noneobjtyping.Any**kwargs= {}_deserialize(- self,
- value : typing.Any,
- attr : str | None,
- data : typing.Mapping[str, typing.Any] | None,
- **kwargs
valuetyping.Anyattrstr | Nonedatatyping.Mapping[str, typing.Any] | None**kwargs= {}
Direction
classDefines the direction in which items are placed in the container.
- Bases
- enum.Enum
Attributes
- COLUMN_ROW= enum.auto()Starting at the top left corner, moving from top to bottom, then from left to right.
- COLUMN_REVERSE_ROW= enum.auto()Starting at the bottom left corner, moving from bottom to top, then from left to right.
- COLUMN_ROW_REVERSE= enum.auto()Starting at the top right corner, moving from top to bottom, then from right to left.
- COLUMN_REVERSE_ROW_REVERSE= enum.auto()Starting at the bottom right corner, moving from bottom to top, then from right to left.
- ROW_COLUMN= enum.auto()Starting at the top left corner, moving from left to right, then from top to bottom.
- ROW_COLUMN_REVERSE= enum.auto()Starting at the bottom left corner, moving from left to right, then from bottom to top.
- ROW_REVERSE_COLUMN= enum.auto()Starting at the top right corner, moving from right to left, then from top to bottom.
- ROW_REVERSE_COLUMN_REVERSE= enum.auto()Starting at the bottom right corner, moving from right to left, then from bottom to top.
HalfSphere
class3D Shape. A solid shape with a circular base shape, that arcs smoothly down from the base to the lowest point at a certain height (equivalent to the radius of the base shape).
- MRO
- └─ HalfSphere
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
Attributes
- radiusDecimal = dataclasses.field(init=False, default=(Decimal()))
Pyramid
class3D shape. A five-faced solid shape with a rectangular base shape and the lateral surfaces as triangles that meet at a common vertex at a certain height. The apex is at the bottom (height=0) and the rectangular base is at the top (height=self.height).
Methods
__post_init__(self) -> None
Attributes
PyramidalFrustum
class3D shape. A solid shape with 6 faces. A pyramidal frustum is the lower portion or base of a pyramid that is a result of cutting off the upper portion by a plane parallel to the base of the shape. If the width and length of the lower and the upper plane are equal respectively, the pyramidal frustum is called a square frustum. The lower (smaller) base is at the bottom (height=0) and the upper (larger) base is at the top (height=self.height).
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
Attributes
Shape
classA 3D solid shape with a certain height that can be filled with liquid.
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> Nonewidth_at_height(self, height : Number) -> decimal.DecimalCalculate the width (x-axis extent) of this shape's cross-section at a given height. For circular shapes this returns the diameter. For rectangular shapes this returns the width of the cross-section.
heightThe height within this shape.decimal.DecimalThe width in mm of the cross-section at the given height.depth_at_height(self, height : Number) -> decimal.DecimalCalculate the depth (y-axis extent) of this shape's cross-section at a given height. For circular shapes this returns the diameter. For rectangular shapes this returns the depth of the cross-section.
heightThe height within this shape.decimal.DecimalThe depth in mm of the cross-section at the given height.
Attributes
- heightDecimal = dataclasses.field(default=(Decimal()))
- max_fitting_volumedecimal.Decimal = NoneThe maximum volume that fits into this shape.
SphericalCap
classA solid shape in form of the cap of a sphere. If the height is equal to the radius of the sphere, the spherical cap turn into a half sphere.
- MRO
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
Attributes
- radiusDecimal = dataclasses.field(default=(Decimal()))
SphericalSegment
class3D Shape. A spherical segment is the solid defined by cutting a sphere or a ball with a pair of parallel planes. It can be thought of as a spherical cap with the top truncated, and so it corresponds to a spherical frustum.
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
Attributes
Stacked
classComposition of multiple solid shapes ordered from top to bottom.
Methods
__post_init__(self) -> NoneGet the section at a given height and the local height within it. Sections are stored top-to-bottom but traversed bottom-to-top (i.e. height 0 is at the bottom of the lowest section).
heightThe height from the bottom of the stacked shape.tuple[Shape, decimal.Decimal]A tuple of (section, local_height_within_section).
Attributes
Vector
classRepresents coordinates in a Cartesian coordinate system. In the context of robotics, imagine to face the machine's front: the system's origin is the bottom left corner next to you. ``` z ↑ y | ↗ └ - → x ```
- Decorators
- dataclasses.dataclass
Methods
__bool__(self) -> boolbool
Attributes
- xDecimal = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=(Decimal(default=0)))
- yDecimal = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=(Decimal(default=0)))
- zDecimal = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=(Decimal(default=0)))
AccessGrid
classChess-key-addressable grid of access points.
- Bases
- collections.abc.Mapping[str | int, AccessPoint]
- Decorators
- dataclasses.dataclass(frozen=True)
Methods
__init__(self, points : dict[str | int, AccessPoint]) -> Nonepointsdict[str | int, AccessPoint]__len__(self) -> intint__iter__(self) -> collections.abc.Iterator[str | int]collections.abc.Iterator[str | int]
Attributes
- pointsdict[str | int, AccessPoint] = None
AccessPoint
classA pipettable position: a physical hole and its owning container.
Pipettable
classGroup of Fillable or Fillable-like objects that can be pipetted. Provides a key-addressable grid of access points (Hole:Container mapping).
- MRO
- └ Group
- └─ Pipettable
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None@typing.override
_index(self, key : int | str | slice) -> int | slicekeyint | str | sliceint | sliceaccess_point(self, key : str | int) -> AccessPointReturn access point for the given key.
keystr | int_get_access_points_for_channels(self, channels : collections.abc.Sequence[int]) -> list[AccessPoint]Get the access points addressed by the given channel indices.
channelscollections.abc.Sequence[int]list[AccessPoint]get_holes_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Hole]Get the physical holes addressed by the given channel indices. Uses the access grid to resolve channel indices to holes. For plates, each channel maps to a unique hole. For troughs, multiple channels may resolve to the same physical hole.
channelscollections.abc.Sequence[int]Zero-based channel indices (0 = A1, 1 = B1, ...).list[Hole]The holes corresponding to the given channels, in order.get_containers_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Container]Get the containers addressed by the given channel indices. Uses the access grid to resolve channel indices to containers. For plates, each channel maps to a unique container. For troughs, multiple channels may resolve to the same container.
channelscollections.abc.Sequence[int]Zero-based channel indices (0 = A1, 1 = B1, ...).list[Container]The containers corresponding to the given channels, in order.
Attributes
- colsint = 1
- rowsint = 1
- _access_gridAccessGrid | None = dataclasses.field(default=None, init=False, repr=False)
- loggerlogging.Logger = NoneReturn the logger for this resource.
- access_gridAccessGrid = NoneReturn the key-addressable access grid.
- containerslist[Container] = NoneContainers for each compartment (child), in order.
PipettableTarget
classProtocol for objects that can be pipetted.
- Bases
- typing.Protocol
- Decorators
- typing.runtime_checkable
Methods
Attributes
- colsint = None
- rowsint = None
Lid
classLid for plates.
Methods
Attributes
Plate
classAbstract base class for plate resources.
- Bases
- Pipettable[Well],
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self, *args, **kwargs) -> None*args= ()**kwargs= {}__contains__(self, item : object) -> boolitemobjectbool
Attributes
- colsint = 12
- rowsint = 8
- grab_heightDecimal = dataclasses.field(default=(Decimal()))
Standard96Plate
classStandard 96-well plate.
- MRO
- └ Labware
- └── Liddable
- └─── Group
- └──── Pipettable
- └───── Plate
- └────── Standard96Plate
- Decorators
- dataclasses.dataclass
Methods
Attributes
- colsint = 12
- rowsint = 8
- grab_heightDecimal = dataclasses.field(default=(Decimal(default=13.2)))
- childrencollections.abc.Sequence[Well] = dataclasses.field(repr=False, default_factory=(lambda: [(Well(container=(Container(max_volume=300, sections=[Cylinder(radius=3.48, height=10.67)])), dimensions=dimension).copy(location=location)) for location, dimension in (place_standardized(count=96))]))
Standard384Plate
classStandard 384-well plate.
- MRO
- └ Labware
- └── Liddable
- └─── Group
- └──── Pipettable
- └───── Plate
- └────── Standard384Plate
- Decorators
- dataclasses.dataclass
Methods
Attributes
- colsint = 24
- rowsint = 16
- grab_heightDecimal = dataclasses.field(default=(Decimal(default=13.2)))
- childrencollections.abc.Sequence[Well] = dataclasses.field(repr=False, default_factory=(lambda: [(Well(container=(Container(max_volume=100, sections=[Cylinder(radius=1.74, height=10.67)])), dimensions=dimension).copy(location=location)) for location, dimension in (place_standardized(count=384))]))
Standard1536Plate
classStandard 1536-well plate.
- MRO
- └ Labware
- └── Liddable
- └─── Group
- └──── Pipettable
- └───── Plate
- └────── Standard1536Plate
- Decorators
- dataclasses.dataclass
Methods
Attributes
- colsint = 48
- rowsint = 32
- grab_heightDecimal = dataclasses.field(default=(Decimal(default=13.2)))
- childrencollections.abc.Sequence[Well] = dataclasses.field(repr=False, default_factory=(lambda: [(Well(container=(Container(max_volume=15, sections=[Cylinder(radius=1.74, height=10.67)])), dimensions=dimension).copy(location=location)) for location, dimension in (place_standardized(count=1536))]))
Well
classWell of a microtitre plate.
Methods
__init__(- self,
- children : collections.abc.Sequence[T],
- cols : int,
- rows : int,
- container : Container,
- shape : FillableShape,
- bottom_type : FillableBottomType
__post_init__(self, *kwargs) -> None*kwargs= ()
Attributes
- shapeFillableShape = FillableShape.SQUARE
- bottom_typeFillableBottomType = FillableBottomType.FLAT
- labelstr = NoneLabel of the well, e.g. A1 or H8.
ChildrenField
classA field that deserializes a list of resources.
- Bases
- marshmallow.fields.Pluck
Methods
_deserialize(- self,
- value : typing.Any,
- attr : str,
- data : dict[str, typing.Any],
- partial : bool | None,
- **kwargs
valuetyping.Anyattrstrdatadict[str, typing.Any]partialbool | None = None**kwargs= {}typing.Any
Instrument
classSpecialist equipment to perform work with it, e.g. spectrometer or incubator.
- MRO
- └ Labware
- └─ Instrument
- Decorators
- dataclasses.dataclass
Methods
__init__(self, tags : dict) -> Nonetagsdict
JsonSchema
classThe structure used when serializing resources.
- Bases
- typing.TypedDict
Attributes
- rootstr = None
- resourcesdict[str, dict[str, typing.Any]] = None
Labware
classAll the equipment used in many different types of laboratory.
MissingError
classRaised when a resource was expected but none was found.
- Bases
- RuntimeError
OccupiedError
classRaised when a resource is already filling the spot.
- Bases
- RuntimeError
Resource
classBase class for labware resources.
- Decorators
- marshmallow_dataclass.dataclass(base_schema=ResourceSchema)
Methods
__post_init__(self, *_kwargs) -> None*_kwargs= ()__init_subclass__(cls) -> None@deprecation.deprecated(deprecated_in='0.1.20', removed_in='0.2.0', current_version=__version__, details='Use `rotate_by` instead.')
rotate(self, angle : int) -> NoneRotate clockwise by the given angle in degrees. Use negative numbers for counter clockwise rotation.
angleintThe angle in degrees to rotate the resource. Must be a multiple of 90°.rotate_by(self, angle : int) -> NoneRotate clockwise by the given angle in degrees. Use negative numbers for counter clockwise rotation.
angleintThe angle in degrees to rotate the resource. Must be a multiple of 90°.rotate_to(self, angle : int) -> NoneRotate to the given absolute angle in degrees.
angleintThe angle in degrees to rotate the resource. Must be a multiple of 90°.__contains__(self, item : object) -> boolCheck whether a resource is assigned to this resource.
itemobjectThe resource to search for.boolTrue if the resource could be found, False otherwise.copy(self, **changes) -> typing.SelfReturn a copy of this resource.
**changes= {}Replace fields with values from `changes`.typing.SelfA copy of this resource.serialize(self) -> JsonSchemaSerialize this resource as a JSON-like dictionary.
The JSON-like dictionary with the resource's data.@classmethod
deserialize(cls, identifier : str, schema : JsonSchema) -> typing.SelfDeserialize a JSON-like dictionary to a resource.
identifierstrThe identifier of the resource to deserialize.schemaThe JSON-like dictionary with the resource's data.typing.SelfThe newly created resource.
Attributes
- identifierstr = dataclasses.field(default_factory=(lambda: str(uuid.uuid4().hex[:8])))
- rotationint = 0
- dimensionsVector = dataclasses.field(default_factory=Vector)
- locationVector | None = None
- Schematype[marshmallow.Schema] = marshmallow.Schema
- namestr = NoneA human readable name to identify resources.
- indexint = NoneThe index of this resource in its parent.
- absolute_locationVector = NoneThe absolute location of this resource.
- widthdecimal.Decimal = NoneThe size of the resource along the x-axis.
- depthdecimal.Decimal = NoneThe size of the resource along the y-axis.
- heightdecimal.Decimal = NoneThe size of the resource along the z-axis.
- centerVector = NoneThe center base of this resource.
ResourceSchema
classSchema for serializing and deserializing resources.
- Bases
- marshmallow.Schema
Attributes
- TYPE_MAPPINGtyping.ClassVar = {Decimal: DecimalField, Vector: VectorField, decimal.Decimal: DecimalField}
- identifier= marshmallow.fields.String()
- type= marshmallow.fields.Function(lambda obj: obj.__class__.__name__, dump_only=True)
- parent= marshmallow.fields.Pluck(_resource_schema_factory, 'identifier', dump_only=True, allow_none=True)
- location= VectorField(allow_none=True)
Tip
classA single tip.
Methods
Attributes
- fitting_depthDecimal = dataclasses.field(default=(Decimal()))
- containerContainer = dataclasses.field(default_factory=Container)
- blowout_air_volumeDecimal = dataclasses.field(default=(Decimal()))
- transport_air_volumeDecimal = dataclasses.field(default=(Decimal()))
- total_volumedecimal.Decimal = NoneThe total volume of liquid in the tip.
- free_volumedecimal.Decimal = NoneThe freely available volume in µl in the tip.
TipRack
classTip racks are the source for providing pipettes with disposable or reusable tips.
Methods
__init__(- self,
- tags : dict,
- children : collections.abc.Sequence[S],
- filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None],
- cols : int,
- rows : int
tagsdictchildrencollections.abc.Sequence[S]filled_atdataclasses.InitVar[collections.abc.Sequence[int | str] | None] = NoneIndices in which spots to fill the labware. Defaults to all spots.colsint = 12The number of tips in the x direction.rowsint = 8The number of tips in the y direction.@typing.override
_index(self, key : int | str | slice) -> int | slicekeyint | str | sliceint | slice
Attributes
- colsint = 12
- rowsint = 8
- RACK_DIMENSIONSVector = Vector()
- loggerlogging.Logger = NoneLogger for this tip rack.
TipSpot
classOptionally hold a tip at a predefined location on a tip rack.
Methods
StandardTrough
classA standard trough.
- MRO
- └ Labware
- └── Group
- └─── Pipettable
- └──── Trough
- └───── StandardTrough
- Decorators
- dataclasses.dataclass
Methods
Attributes
- colsint = 12
- rowsint = 8
- dimensionsVector = dataclasses.field(default_factory=(lambda: Vector(z=44)))
- childrencollections.abc.Sequence[Fillable] = dataclasses.field(repr=False, default_factory=(lambda: [Fillable(container=(Container(max_volume=300000, sections=[Cuboid(width=108, depth=72, height=40)])), children=[(Hole(dimensions=dimensions).copy(location=location)) for location, dimensions in (place_standardized(count=96, boundary_height=44, item_height=40))])]))
StandardTrough8Row
classAn 8-row trough with 96 holes for simultaneous pipetting operations.
- MRO
- └ Labware
- └── Group
- └─── Pipettable
- └──── Trough
- └───── StandardTrough
- └────── StandardTrough8Row
- Decorators
- dataclasses.dataclass
Methods
Attributes
- colsint = 12
- rowsint = 8
- dimensionsVector = dataclasses.field(default_factory=(lambda: Vector(z=44)))
- childrencollections.abc.Sequence[Fillable] = dataclasses.field(repr=False, default_factory=(lambda: [(Fillable(container=(Container(max_volume=(300000 / 8), sections=[Cuboid(width=108, depth=(72 / 8), height=40)])), children=[(Hole(dimensions=dimensions).copy(location=location)) for location, dimensions in (place(cols=12, rows=1, item=(Vector(x=9, y=9, z=40)), boundary=(Vector(x=108, y=(72 / 8), z=40)), justify=(Alignment.CENTER), align=(Alignment.CENTER)))]).copy(location=fillable_location)) for fillable_location, _ in (place(cols=1, rows=8, item=(Vector(x=108, y=(72 / 8), z=40)), boundary=(Vector(x=108, y=72, z=40)), justify=(Alignment.CENTER), align=(Alignment.SPACE_EVENLY)))]))
StandardTrough12Column
classA 12-column trough with 96 holes for simultaneous pipetting operations.
- MRO
- └ Labware
- └── Group
- └─── Pipettable
- └──── Trough
- └───── StandardTrough
- └────── StandardTrough12Column
- Decorators
- dataclasses.dataclass
Methods
Attributes
- colsint = 12
- rowsint = 8
- dimensionsVector = dataclasses.field(default_factory=(lambda: Vector(z=44)))
- childrencollections.abc.Sequence[Fillable] = dataclasses.field(repr=False, default_factory=(lambda: [(Fillable(container=(Container(max_volume=(300000 / 12), sections=[Cuboid(width=(108 / 12), depth=72, height=40)])), children=[(Hole(dimensions=dimensions).copy(location=location)) for location, dimensions in (place(cols=1, rows=8, item=(Vector(x=9, y=9, z=40)), boundary=(Vector(x=(108 / 12), y=72, z=40)), justify=(Alignment.CENTER), align=(Alignment.CENTER)))]).copy(location=fillable_location)) for fillable_location, _ in (place(cols=12, rows=1, item=(Vector(x=(108 / 12), y=72, z=40)), boundary=(Vector(x=108, y=72, z=40)), justify=(Alignment.SPACE_EVENLY), align=(Alignment.CENTER)))]))
Trough
classA trough with one or more Fillable compartments. Each child Fillable represents one independent liquid body (compartment).
- MRO
- └ Labware
- └─ Group
- └── Pipettable
- └─── Trough
- Bases
- Pipettable[Fillable],
- Decorators
- dataclasses.dataclass
Methods
Cap
classCap for tubes.
StandardTubeRack
classA tube rack for holding tubes, with ANSI standard footprint.
- MRO
- └ Labware
- └── Group
- └─── Rack
- └──── TubeRack
- └───── StandardTubeRack
- Decorators
- dataclasses.dataclass
Methods
__init__(- self,
- tags : dict,
- children : collections.abc.Sequence[TubeSpot],
- filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None],
- cols : int,
- rows : int,
- dimensions : Vector
tagsdictchildrencollections.abc.Sequence[TubeSpot]The type of tubes this rack is filled with.filled_atdataclasses.InitVar[collections.abc.Sequence[int | str] | None] = NoneIndices in which spots to fill the labware. Defaults to all spots.colsint = 6The number of tubes in the x direction. Defaults to 6.rowsint = 4The number of tubes in the y direction. Defaults to 4.dimensions
Attributes
- dimensionsVector = dataclasses.field(default_factory=(lambda: Vector(z=40)))
- rowsint = 4
- colsint = 6
- childrencollections.abc.Sequence[TubeSpot] = dataclasses.field(repr=False, default_factory=(lambda: [(TubeSpot(dimensions=dimensions).copy(location=location)) for location, dimensions in (place(StandardTubeRack.cols, StandardTubeRack.rows, item=(Vector(x=(ANSI_SLAS_FOOTPRINT.x / StandardTubeRack.cols), y=(ANSI_SLAS_FOOTPRINT.y / StandardTubeRack.rows), z=(decimal.Decimal(40)))), boundary=ANSI_SLAS_FOOTPRINT))]))
Tube
classA tube.
Methods
__init__(- self,
- tags : dict,
- lid : Cap | None,
- children : collections.abc.Sequence[T],
- cols : int,
- rows : int,
- container : Container,
- shape : FillableShape,
- bottom_type : FillableBottomType
__post_init__(self, *kwargs) -> None*kwargs= ()
Attributes
- lidCap | None = dataclasses.field(repr=False, default=None)
- shapeFillableShape = FillableShape.CIRCLE
- bottom_typeFillableBottomType = FillableBottomType.FLAT
- labelstr = NoneLabel of the tube, e.g. A1 or H8.
TubeRack
classBase class for tube racks.
Methods
__init__(- self,
- tags : dict,
- children : collections.abc.Sequence[S],
- filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None],
- cols : int,
- rows : int
tagsdictchildrencollections.abc.Sequence[S]The type of tubes this rack is filled with.filled_atdataclasses.InitVar[collections.abc.Sequence[int | str] | None] = NoneIndices in which spots to fill the labware. Defaults to all spots.colsint = 6The number of tubes in the x direction.rowsint = 4The number of tubes in the y direction.@typing.override
_index(self, key : int | str | slice) -> int | slicekeyint | str | sliceint | sliceget_containers_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Container]Return containers for the given channel indices. Collects containers from occupied tubes in order. Raises IndexError if any channel index is out of range.
channelscollections.abc.Sequence[int]list[Container]
Attributes
- colsint = 6
- rowsint = 4
- containerslist[Container] = NoneReturn containers from all tubes in the rack.
- heightdecimal.Decimal = NoneReturn the height of the tube rack. The height is the max of the tube rack's own height and the height of the tallest tube.
TubeSpot
classOptionally hold a tube at a predefined location on a tube rack.
Methods
LabwareEncoder
classJSON encoder for labware objects.
- Bases
- json.JSONEncoder
Methods
@typing.override
default(self, o : object) -> typing.AnyEncode a labware object.
oobjecttyping.Any
Level
classLogging levels.
- Bases
- enum.IntEnum
Attributes
- CRITICAL= logging.CRITICAL
- FATAL= logging.CRITICAL
- ERROR= logging.ERROR
- WARN= logging.WARNING
- WARNING= logging.WARNING
- INFO= logging.INFO
- DEBUG= logging.DEBUG
- NOTSET= logging.NOTSET
MissingType
classSentinel object to detect if a parameter is supplied or not.
Methods
__repr__(self) -> strstr
Serializable
classSerialize this class into its json representation and back.
- Bases
- typing.Protocol
Methods