UniteLabs
package

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.tubes.tube_rack.Standard96TubeRack", "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.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

    class

    Carriers 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.

    MRO
    Bases
    Rack[CarrierSite[T], T],
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[S],
        filled_with : dataclasses.InitVar[None | T | type[T]],
        filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None]
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[S]
      filled_with
      dataclasses.InitVar[None | T | type[T]] = None
      filled_at
      dataclasses.InitVar[collections.abc.Sequence[int | str] | None] = None
    • @typing.override

      __setitem__(self, key : int | str | slice, value : T | None | collections.abc.Sequence[T | None]) -> None

      key
      int | str | slice
      value
      T | None | collections.abc.Sequence[T | None]
  • CarrierSite

    class

    Optionally hold labware at a predefined location on a carrier.

    MRO
    Bases
    Spot[T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        children : collections.abc.Sequence[T],
      ) -> None

      children
      collections.abc.Sequence[T]
      orientation
    • @deprecation.deprecated(deprecated_in='0.1.20', removed_in='0.2.0', current_version='0.1.20', details='Use assignment (`carrier[4] = labware`) instead.')

      set(self, resource : T) -> None

      Assign the given resource to this carrier site.

      resource
      The resource to assign to this carrier site.
    • @typing.override

      can_assign(
        self,
        **kwargs
      ) -> typing.TypeGuard[T]

      resource
      **kwargs
      = {}
      typing.TypeGuard[T]
    • @typing.override

      assign(
        self,
        **kwargs
      ) -> None

      resource
      **kwargs
      = {}

    Attributes

  • Orientation

    class

    The carrier site orientation.

    Bases
    str, enum.Enum

    Attributes

    • LANDSCAPE
      = 'LANDSCAPE'
    • PORTRAIT
      = 'PORTRAIT'
  • StandardMicroplateDimensions

    class

    ANSI/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) -> None

      tags
      dict
    • __post_init__(self, *args, **kwargs) -> None

      *args
      = ()
      **kwargs
      = {}
  • Adapter

    class

    Hold 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.

    MRO
    Bases
    Group[S], typing_extensions.Generic[S, T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, children : collections.abc.Sequence[T]) -> None

      children
      collections.abc.Sequence[T]
    • get(self) -> T | None

      Access the spot.

      T | None
    • @log()

      add(self, labware : T) -> None

      Assign the labware to this adapter.

      labware
      The labware to assign.
    • @log()

      clear(self) -> None

      Clear the adapter by removing any labware assigned to it.

    • @log()

      remove(self) -> T | None

      Remove the resource in this adapter.

      T | None
      The resource that was removed from this adapter, if available.
    • @typing.override

      __getitem__(self, key : typing_extensions.Literal[0, '0']) -> S

      Subscript the adapter to access the spot. Implemented to conserve the interface compared to `Rack`.

      key
      typing_extensions.Literal[0, '0']
      The key of the child to get.
      The child at the given key.
    • __setitem__(self, key : typing_extensions.Literal[0, '0'], value : T | None) -> None

      Assign a child to the adapter at the given key. Implemented to conserve the interface compared to `Rack`.

      key
      typing_extensions.Literal[0, '0']
      The key where to assign the child to.
      value
      T | None
      The child to assign.
    • __delitem__(self, key : typing_extensions.Literal[0, '0']) -> None

      Unassign the child from the adapter at the given key. Implemented to conserve the interface compared to `Rack`.

      key
      typing_extensions.Literal[0, '0']
      The key where to unassign the child from.

    Attributes

    • children
      collections.abc.Sequence[S] = dataclasses.field(init=False, repr=False, default_factory=list)
  • Deck

    class

    The deck is the area in which labware is arranged for usage by the liquid handling system.

    MRO
    Bases
    Group[T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, children : collections.abc.Sequence[T]) -> None

      children
      collections.abc.Sequence[T]
    • get(self, identifier : str) -> Labware

      Find and return labware with the given identifier on the deck.

      identifier
      str
      The labware's identifier.
      The labware with the given identifier.
    • @log()

      add(self, labware : Labware, **kwargs) -> None

      Add the labware to this deck.

      labware
      The labware to add to the deck.
      **kwargs
      = {}
      Additional arguments for the liquid handler.
    • @log()

      remove(self, labware : Labware, **kwargs) -> None

      Remove the labware from this deck.

      labware
      The labware to remove from the deck.
      **kwargs
      = {}
      Additional arguments for the liquid handler.
    • @log()

      clear(self) -> None

      Remove all labware from this deck.

    • summary(self) -> str

      Summarize the main resources of the current deck layout.

      str
      The deck layout summary.
    • can_assign(
        self,
        **kwargs
      ) -> typing.TypeGuard[T]

      Verify whether the given resource can be assigned to this deck.

      resource
      The resource to assign to this deck.
      _location
      Vector | None = None
      The location where to place the resource relative to the deck's origin.
      **kwargs
      = {}
      Additional arguments for the deck.
      typing.TypeGuard[T]
      True if the resource can be assigned, otherwise raise an error.
    • assign(
        self,
        **kwargs
      ) -> None

      Assign the given resource to this deck.

      resource
      The resource to assign to this deck.
      location
      Vector | None = None
      The location where to place the resource relative to the deck's origin.
      **kwargs
      = {}
      Additional arguments for the deck.
    • can_unassign(
        self,
        **kwargs
      ) -> typing.TypeGuard[T]

      Verify whether the given resource can be unassigned from this deck.

      resource
      The 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.
    • unassign(
        self,
        **kwargs
      ) -> None

      Unassign the given resource from this deck.

      resource
      The resource to unassign from this deck.
      **kwargs
      = {}
      Additional arguments for the deck.
    • 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.Self

      Load deck configuration from dictionary.

      deck_dict
      dict[str, typing.Any]
      The JSON-compatible dictionary containing deck configuration.
      typing.Self
      The newly created deck instance.
    • _rebuild_index(self) -> None

      For Subclasses to rebuild their internal position index after deserialization.

    • _restore_parent_refs_and_index(self, loaded : typing.Self) -> None

      Restore parent references and rebuild the index after in-place deserialization.

      loaded
      typing.Self
      The newly deserialized deck instance to copy state from.
    • save(self, file_path : str | pathlib.Path) -> None

      Save deck configuration to JSON file.

      file_path
      str | pathlib.Path
      The path where to save the deck configuration.
    • @classmethod

      load(cls, file_path : str | pathlib.Path) -> typing.Self

      Load deck configuration from JSON file.

      file_path
      str | pathlib.Path
      The path to the JSON file containing deck configuration.
      typing.Self
      The newly created deck instance.

    Attributes

    • logger
      logging.Logger = None
      The logger for this deck.
  • Group

    class

    A resource with the ability to hold or combine other resources.

    Bases
    typing.Generic[T],
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, children : collections.abc.Sequence[T]) -> None

      children
      collections.abc.Sequence[T]
    • __post_init__(self, *kwargs) -> None

      *kwargs
      = ()
    • __init_subclass__(cls) -> None

    • @typing.override

      rotate_by(self, angle : int) -> None

      angle
      int
    • find(self, identifier : str) -> Resource

      Find and return the resource with the given identifier on this group.

      identifier
      str
      The resource's identifier.
      The resource with the given identifier.
    • __contains__(self, item : object) -> bool

      item
      object
      bool
    • __getitem__(self, key : int | str | slice) -> T | collections.abc.Sequence[T]

      key
      int | str | slice
      T | collections.abc.Sequence[T]
    • __len__(self) -> int

      Get the number of children in this group.

      int
      The number of children in this group.
    • __iter__(self) -> collections.abc.Iterator[T]

      Iterate over the children of this group.

      collections.abc.Iterator[T]
      An iterator to iterate over all children in this group.
    • _index(self, key : int | str | slice) -> int | slice

      key
      int | str | slice
      int | slice
    • copy(self, **changes) -> typing.Self

      Copy this group.

      **changes
      = {}
      Additional arguments for the group.
      typing.Self
      The copied group.
    • serialize(self) -> JsonSchema

      Serialize this group.

      The serialized group.

    Attributes

    • children
      collections.abc.Sequence[T] = dataclasses.field(metadata={'marshmallow_field': marshmallow.fields.List(ChildrenField(Resource.Schema(), 'identifier'))}, repr=False, default_factory=list)
  • Rack

    class

    A framework for holding or storing labware in pre-defined spots.

    MRO
    Bases
    Group[S], typing.Generic[S, T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        children : collections.abc.Sequence[S],
        filled_with : dataclasses.InitVar[None | T | type[T]],
        filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None]
      ) -> None

      children
      collections.abc.Sequence[S]
      filled_with
      dataclasses.InitVar[None | T | type[T]] = None
      The type of labware this rack is filled with.
      filled_at
      dataclasses.InitVar[collections.abc.Sequence[int | str] | None] = None
      Indices in which spots to fill the labware. Defaults to all spots.
    • __post_init__(
        self,
        filled_with : None | T | type[T],
        filled_at : collections.abc.Sequence[int | str] | None,
        *kwargs
      ) -> None

      filled_with
      None | T | type[T]
      filled_at
      collections.abc.Sequence[int | str] | None
      *kwargs
      = ()
    • get(self, key : int | str) -> T | None

      Access the labware in the spot at the given key.

      key
      int | str
      The key of the spot from which to access the labware.
      T | None
    • @log()

      add(self, labware : T, key : int | str) -> None

      Add labware to the spot at the given key.

      labware
      The labware to add to the spot.
      key
      int | str
      The key of the spot where to add the labware.
    • @log()

      fill(self, labware : T | type[T] | collections.abc.Callable[[], T] | collections.abc.Sequence[T], spots : collections.abc.Sequence[Spot[T]] | None) -> None

      Fill the spots of the rack with the given labware.

      labware
      T | type[T] | collections.abc.Callable[[], T] | collections.abc.Sequence[T]
      The labware to assign to the spots. Pass either a class or instance of labware that is copied or a list with the labware instance for each spot.
      spots
      collections.abc.Sequence[Spot[T]] | None = None
      The spots in which to assign the labware.
    • @log()

      remove(self, key : int | str) -> T | None

      Remove labware from the spot at the given key.

      key
      int | str
      The key of the spot from where to remove the labware.
      T | None
      The labware that was removed, if any.
    • @log()

      clear(self, spots : collections.abc.Sequence[Spot[T]] | None) -> collections.abc.Sequence[T | None]

      Clear the spots of the rack.

      spots
      collections.abc.Sequence[Spot[T]] | None = None
      The spots from which to unassign the labware.
      collections.abc.Sequence[T | None]
      The list of labware that was removed, if any.
    • __setitem__(self, key : int | str | slice, value : T | None | collections.abc.Sequence[T | None]) -> None

      key
      int | str | slice
      value
      T | None | collections.abc.Sequence[T | None]
    • __delitem__(self, key : int | str | slice) -> None

      key
      int | str | slice
    • serialize(self) -> JsonSchema

      Serialize rack, flattening spots to directly serialize their children.

      The serialized rack configuration.
    • @classmethod

      deserialize(cls, identifier : str, schema : JsonSchema) -> typing.Self

      Deserialize rack, reconstructing spots from flattened children.

      identifier
      str
      The identifier of the rack to deserialize.
      The JSON schema containing the rack data.
      typing.Self
      The newly created rack instance.

    Attributes

    • children
      collections.abc.Sequence[S] = dataclasses.field(repr=False, default_factory=list)
    • logger
      logging.Logger = None
      The logger for this rack.
    • contents
      RackContents[T] = None
      Return a view of all non-empty spot contents, supporting indexing by spot key.
  • Spot

    class

    Optionally holds one item of a certain labware type.

    MRO
    Bases
    Group[T], typing.Generic[T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, children : collections.abc.Sequence[T]) -> None

      children
      collections.abc.Sequence[T]
    • get(self) -> T | None

      Access the labware in the spot. Returns None if the spot is empty.

      T | None
    • add(self, labware : T | None) -> None

      Assign the labware to this spot.

      labware
      T | None
      The labware to assign.
    • remove(self) -> T | None

      Remove the resource in this spot.

      T | None
      The resource that was removed from this spot, if available.
    • can_assign(
        self,
        **kwargs
      ) -> typing.TypeGuard[T]

      Verify whether the given resource can be assigned to this group.

      resource
      Resource | None
      The resource to assign to this group.
      **kwargs
      = {}
      Additional arguments for the group.
      typing.TypeGuard[T]
      True if the resource can be assigned, otherwise raise an error.
    • assign(
        self,
        **kwargs
      ) -> None

      Assign the given resource to this group.

      resource
      Resource | None
      The resource to assign to this group.
      **kwargs
      = {}
      Additional arguments for the group.
    • can_unassign(
        self,
        **kwargs
      ) -> typing.TypeGuard[T]

      Verify whether the given resource can be unassigned from this group.

      resource
      Resource | None = None
      The resource to unassign from this group.
      **kwargs
      = {}
      Additional arguments for the group.
      typing.TypeGuard[T]
      True if the resource can be unassigned, otherwise raise an error.
    • unassign(
        self,
        **kwargs
      ) -> None

      Unassign the given resource from this group.

      resource
      Resource | None = None
      The resource to unassign from this group.
      **kwargs
      = {}
      Additional arguments for the group.
    • reassign(
        self,
        **kwargs
      ) -> None

      Unassign the given resource from this group and assign it another one.

      The target group to which to assign the resource to.
      resource
      Resource | None = None
      The resource to reassign from this group to the other one.
      **kwargs
      = {}
      Additional arguments for the group.

    Attributes

    • children
      collections.abc.Sequence[T | None] = dataclasses.field(init=False, repr=False, default_factory=(lambda: [None]))
    • well_label
      str = None
      Get well label for this spot based on its position in parent (e.g., 'A1', 'B2').
    • child
      T | None = None
      Request the resource in this spot or `None` if the spot is empty.
  • Stack

    class

    Base class for groups of resources that are stacked together and act as a single unit.

    MRO
    Bases
    Group[T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        children : collections.abc.Sequence[T],
        direction : typing.Literal['x', 'y', 'z']
      ) -> None

      children
      collections.abc.Sequence[T]
      direction
      typing.Literal['x', 'y', 'z'] = 'z'
      The direction in which to stack resources.
    • can_assign(
        self,
        **kwargs
      ) -> typing.TypeGuard[T]

      Verify whether the given resource can be assigned to this stack.

      resource
      The resource to assign to this stack.
      _location
      Vector | None = None
      The location where to place the resource relative to the stack's origin.
      **kwargs
      = {}
      Additional arguments for the stack.
      typing.TypeGuard[T]
      True if the resource can be assigned, otherwise raise an error.
    • assign(
        self,
        **kwargs
      ) -> None

      Assign the given resource to this group.

      resource
      The resource to assign to this group.
      location
      Vector | None = None
      The location where to place the resource relative to the group's origin.
      **kwargs
      = {}
      Additional arguments for the group.
    • can_unassign(
        self,
        **kwargs
      ) -> bool

      Verify whether the given resource can be unassigned from this group.

      resource
      The resource to unassign from this group.
      **kwargs
      = {}
      Additional arguments for the group.
      bool
      True if the resource can be unassigned, otherwise raise an error.
    • unassign(
        self,
        **kwargs
      ) -> None

      Unassign the given resource from this deck.

      resource
      The resource to unassign from this deck.
      **kwargs
      = {}
      Additional arguments for the deck.

    Attributes

    • direction
      typing.Literal['x', 'y', 'z'] = 'z'
    • width
      decimal.Decimal = None
    • depth
      decimal.Decimal = None
    • height
      decimal.Decimal = None
  • Trash

    class

    Trash area.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, name : str) -> None

      name
      str = 'Trash'

    Attributes

    • name
      str = 'Trash'
  • UnassignedError

    class

    Raised when a resource is not assigned to a specific group.

    Bases
    RuntimeError
  • Container

    class

    Hold and manage liquids in a container.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      height
      sections
      list[Shape]
      max_volume
      The maximum volume in µl that can safely be added to the container.
      liquids
    • __post_init__(self) -> None

    • can_add_liquid(self, volume : Number) -> decimal.Decimal

      Check if a certain volume of liquid can be added to this container.

      volume
      The volume of liquid in µl to add.
      decimal.Decimal
      The volume of liquid in µl that can be added to this container.
    • @log()

      add_liquid(
        self,
        is_estimate : bool
      ) -> None

      Add a certain volume of liquid into this container.

      liquid
      The type of liquid to add.
      volume
      The volume of liquid in µl to add.
      is_estimate
      bool = False
      Whether the volume is an estimate. Defaults to False.
    • @log()

      add_liquids(
        self,
        is_estimate : bool
      ) -> None

      Add a mixture of liquids into this container.

      liquids
      collections.abc.Sequence[tuple[Liquid | Sample, Number]]
      A sequence of tuples containing the liquid and volume to add.
      is_estimate
      bool = False
      Whether 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.Decimal

      Check if a certain volume of liquid can be removed from this container.

      volume
      The volume of liquid in µl to remove.
      strict
      bool = True
      Whether to raise if volume cannot be removed. Defaults to True.
      decimal.Decimal
      The volume of liquid in µl that can be removed from this container.
    • @log()

      remove_liquid(self, volume : Number, strict : bool) -> Mixture

      Remove a certain volume from this container.

      volume
      The volume of liquid in µl to remove.
      strict
      bool = True
      Whether to raise if volume cannot be removed. Defaults to True.
      The Mixture of Liquids that were removed.

    Attributes

    • max_volume
      Decimal = dataclasses.field(default=(Decimal()))
    • liquids
      Mixture = dataclasses.field(metadata={'marshmallow_field': MixtureField()}, default_factory=Mixture)
    • _liquid_level
      = Decimal()
    • _volume_is_estimate
      bool = dataclasses.field(default=False, init=False, repr=False, metadata={'marshmallow_field': marshmallow.fields.Boolean(data_key='volume_is_estimate')})
    • logger
      logging.Logger = None
      The logger for this container.
    • volume
      decimal.Decimal = None
      The current volume in µl of liquid filling the container.
    • free_volume
      decimal.Decimal = None
      The freely available volume in µl in the container.
    • liquid_level
      decimal.Decimal = None
      The height of the liquid in the container, in mm.
  • Fillable

    class

    Any resource that can be filled with liquids.

    MRO
    Bases
    Group[Hole]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        children : collections.abc.Sequence[T],
        cols : int,
        rows : int,
      ) -> None

      children
      collections.abc.Sequence[T]
      cols
      int = 1
      rows
      int = 1
      container
    • get_holes_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Hole]

      Return holes for each channel. If channels is longer than the number of holes, restart from the first hole.

      channels
      collections.abc.Sequence[int]
      list[Hole]
    • get_containers_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Container]

      Return container for each channel.

      channels
      collections.abc.Sequence[int]
      list[Container]

    Attributes

    • cols
      int = 1
    • rows
      int = 1
    • container
      Container = dataclasses.field(default_factory=Container)
    • containers
      list[Container] = None
      Return container as a list for typing compatibility.
  • Hole

    class

    A hole in a container.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self) -> None

  • Liquid

    class

    A 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
      ) -> None

      name
      str
      viscosity
      float | None = None
      density
      float | None = None
      identifier
      str
    • __new__(
        cls,
        name : str,
        viscosity : float | None,
        density : float | None,
        identifier : str | None
      ) -> None

      Create a new Liquid instance.

      name
      str
      The name of the liquid.
      viscosity
      float | None = None
      The viscosity of the liquid, if known.
      density
      float | None = None
      The density of the liquid, if known.
      identifier
      str | None = None
      The unique identifier of the liquid, if known.
    • __hash__(self) -> int

      int
    • __str__(self) -> str

      str
    • __repr__(self) -> str

      str

    Attributes

    • name
      str = None
    • viscosity
      float | None = None
    • density
      float | None = None
    • identifier
      str = dataclasses.field(default_factory=(lambda: str(uuid.uuid4().hex[:8])), compare=False)
  • LiquidClass

    class

    Liquid 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.

    Bases
    typing.Generic[A_co, D_co]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, liquid : Mixture) -> None

      liquid
    • __str__(self) -> str

      str

    Attributes

    • liquid
      Mixture = dataclasses.field(metadata={'marshmallow_field': MixtureField()})
    • aspirate_parameters
      A_co = None
      Parameter set used for the aspirate method.
    • dispense_parameters
      D_co = None
      Parameter set used for the dispense method.
  • LiquidOverflowError

    class

    Raised when a container is too full to add the specified volume of liquid.

    Bases
    Exception
  • LiquidUnderflowError

    class

    Raised when a container is too empty to remove the specified volume of liquid.

    Bases
    Exception
  • Mixture

    class

    Combination of liquids mixed together.

    Bases
    collections.abc.MutableMapping[Liquid | Sample, decimal.Decimal],
    Decorators
    dataclasses.dataclass()

    Methods

    • __init__(
        self,
      ) -> None

      ingredients
      dict[str | Liquid | Sample, Number] | None = None
      **kwargs
      Number = {}
    • @typing.override

      __len__(self) -> int

      int
    • @typing.override

      __contains__(self, x : object) -> bool

      x
      object
      bool
    • @typing.override

      get(self, key : str | Liquid | Sample, default : Number | None) -> decimal.Decimal | None

      key
      str | Liquid | Sample
      default
      Number | None = None
      decimal.Decimal | None
    • @typing.override

      __getitem__(self, key : str | Liquid | Sample) -> decimal.Decimal

      key
      str | Liquid | Sample
      decimal.Decimal
    • @typing.override

      __setitem__(self, key : str | Liquid | Sample, value : Number) -> None

      key
      str | Liquid | Sample
      value
    • @typing.override

      __delitem__(self, key : str | Liquid | Sample) -> None

      key
      str | Liquid | Sample
    • @typing.override

      __iter__(self) -> collections.abc.Iterator[Liquid | Sample]

      collections.abc.Iterator[Liquid | Sample]
    • @typing.override

      items(self) -> collections.abc.Sequence[tuple[Liquid | Sample, decimal.Decimal]]

      collections.abc.Sequence[tuple[Liquid | Sample, decimal.Decimal]]
    • @typing.override

      keys(self) -> collections.abc.Sequence[Liquid | Sample]

      collections.abc.Sequence[Liquid | Sample]
    • @typing.override

      values(self) -> collections.abc.Sequence[decimal.Decimal]

      collections.abc.Sequence[decimal.Decimal]
    • @typing.override

      clear(self) -> None

    • @typing.override

      pop(self, key : str | Liquid | Sample, default : Number | None) -> decimal.Decimal | None

      key
      str | Liquid | Sample
      default
      Number | None = None
      decimal.Decimal | None
    • @typing.override

      __str__(self) -> None

    • @typing.override

      __repr__(self) -> None

    • @typing.override

      __eq__(self, other : object) -> bool

      other
      object
      bool
    • @typing.override

      __hash__(self) -> int

      int
    • add(self, liquid : str | Liquid | Sample, volume : Number) -> None

      Add volume of liquid to this mixture.

      liquid
      str | Liquid | Sample
      The type of liquid to add.
      volume
      The volume of liquid in µl to add.
    • update(self, other : collections.abc.Mapping[str | Liquid | Sample, Number]) -> None

      Update the mixture with the key/value pairs from another mapping object.

      other
      collections.abc.Mapping[str | Liquid | Sample, Number]
      The mapping object to update from.
    • remove(self, volume : Number) -> Mixture

      Remove volume proportionally from mixture.

      volume
      The volume of liquid in µl to remove.
      The removed mixture of liquid.
    • @typing.override

      serialize(self) -> dict[str, str]

      dict[str, str]
    • @typing.override

      @classmethod

      deserialize(cls, value : dict[str, str]) -> typing.Self

      value
      dict[str, str]
      typing.Self
    • @classmethod

      _key_to_label(cls, key : str | Liquid | Sample) -> Liquid | Sample

      key
      str | Liquid | Sample
    • @classmethod

      _label_to_key(cls, key : str | Liquid | Sample) -> str

      key
      str | Liquid | Sample
      str

    Attributes

    • ingredients
      dict[str, decimal.Decimal] = {}
    • _volume
      = decimal.Decimal(0)
    • logger
      logging.Logger = None
      The logger for this mixture.
    • volume
      decimal.Decimal = None
      The total volume of the mixture.
  • MixtureField

    class

    Mixture field for marshmallow.

    Bases
    marshmallow.fields.Field

    Methods

    • @typing.override

      _serialize(
        self,
        value : typing.Any,
        attr : str | None,
        obj : typing.Any,
        **kwargs
      ) -> typing.Any

      value
      typing.Any
      attr
      str | None
      obj
      typing.Any
      **kwargs
      = {}
      typing.Any
    • @typing.override

      _deserialize(
        self,
        value : typing.Any,
        attr : str | None,
        data : typing.Mapping[str, typing.Any] | None,
        **kwargs
      ) -> typing.Any

      value
      typing.Any
      attr
      str | None
      data
      typing.Mapping[str, typing.Any] | None
      **kwargs
      = {}
      typing.Any
  • Sample

    class

    Traceable sample used in liquid handling.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, name : str, identifier : str) -> None

      name
      str
      identifier
      str
    • __post_init__(self) -> None

    • __str__(self) -> str

      str
    • __hash__(self) -> int

      int

    Attributes

    • name
      str = None
    • identifier
      str = dataclasses.field(default_factory=(lambda: str(uuid.uuid4().hex[:8])))
  • Alignment

    class

    Defines 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

    class

    A shape with with complex dimensions that can be filled with liquid.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, factor : Decimal) -> None

      height
      factor
    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal

    Attributes

    • factor
      Decimal = dataclasses.field(default=(Decimal()))
    • max_fitting_volume
      decimal.Decimal = None
      The maximum volume that fits into this shape.
  • Cone

    class

    A 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).

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, radius : Decimal) -> None

      height
      radius
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • radius
      Decimal = dataclasses.field(default=(Decimal()))
  • ConicalFrustum

    class

    A 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.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      height
      radius_lower
      radius_upper
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • radius_lower
      Decimal = dataclasses.field(default=(Decimal()))
    • radius_upper
      Decimal = dataclasses.field(default=(Decimal()))
  • Cuboid

    class

    A six-faced solid shape with a rectangular base shape and a certain height.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      height
      width
      depth
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • width
      Decimal = dataclasses.field(default=(Decimal()))
    • depth
      Decimal = dataclasses.field(default=(Decimal()))
  • Cylinder

    class

    A solid shape with two parallel circular base shapes joined by a curved surface with a certain height.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, radius : Decimal) -> None

      height
      radius
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • radius
      Decimal = dataclasses.field(default=(Decimal()))
  • Decimal

    class

    Decimal number for fast correctly rounded decimal floating point arithmetic.

    Bases
    decimal.Decimal

    Methods

    • __new__(cls, default : Number) -> None

      Create a new Decimal instance.

      default
      The default value for the Decimal.
    • __init__(self, default : Number) -> None

      Initialize the Decimal instance.

      default
      The default value for the Decimal.
    • __set_name__(self, owner : type[object], name : str) -> None

      owner
      type[object]
      name
      str
    • __get__(self, instance : object | None, owner : type[object] | None) -> decimal.Decimal

      instance
      object | None
      owner
      type[object] | None
      decimal.Decimal
    • __set__(self, instance : object | None, value : Number) -> None

      instance
      object | None
      value
    • @classmethod

      __get_pydantic_core_schema__(
        cls,
        source_type : typing.Any,
        handler : pydantic.GetCoreSchemaHandler
      ) -> pydantic_core.core_schema.CoreSchema

      source_type
      typing.Any
      handler
      pydantic.GetCoreSchemaHandler
      pydantic_core.core_schema.CoreSchema

    Attributes

    • _default_value
      = parse_number(default)
    • _attr_name
      = ''
  • DecimalField

    class

    Decimal field for marshmallow.

    Bases
    marshmallow.fields.Field

    Methods

    • _serialize(
        self,
        value : typing.Any,
        attr : str | None,
        obj : typing.Any,
        **kwargs
      ) -> None

      value
      typing.Any
      attr
      str | None
      obj
      typing.Any
      **kwargs
      = {}
    • _deserialize(
        self,
        value : typing.Any,
        attr : str | None,
        data : typing.Mapping[str, typing.Any] | None,
        **kwargs
      ) -> None

      value
      typing.Any
      attr
      str | None
      data
      typing.Mapping[str, typing.Any] | None
      **kwargs
      = {}
  • Direction

    class

    Defines 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

    class

    3D 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).

    Decorators
    dataclasses.dataclass

    Methods

    Attributes

    • radius
      Decimal = dataclasses.field(init=False, default=(Decimal()))
  • Pyramid

    class

    3D 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).

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
      ) -> None

      height
      width
      depth
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • width
      Decimal = dataclasses.field(default=(Decimal()))
    • depth
      Decimal = dataclasses.field(default=(Decimal()))
  • PyramidalFrustum

    class

    3D 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

    • __init__(
        self,
      ) -> None

      height
      width_lower
      depth_lower
      width_upper
      depth_upper
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • width_lower
      Decimal = dataclasses.field(default=(Decimal()))
    • depth_lower
      Decimal = dataclasses.field(default=(Decimal()))
    • width_upper
      Decimal = dataclasses.field(default=(Decimal()))
    • depth_upper
      Decimal = dataclasses.field(default=(Decimal()))
  • Shape

    class

    A 3D solid shape with a certain height that can be filled with liquid.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal) -> None

      height
    • __post_init__(self) -> None

    • _validate_height(self, height : Number) -> decimal.Decimal

      Validate and parse a height value.

      height
      The height within this shape.
      decimal.Decimal
      The validated height as a Decimal, clamped to the shape's maximum height.
    • volume_for_height(self, height : Number) -> decimal.Decimal

      Calculate the volume within this shape for a particular height.

      height
      The height within this shape.
      decimal.Decimal
      The inner shape's volume in µl with the given height.
    • height_for_volume(self, volume : Number) -> decimal.Decimal

      Calculate the height within this shape for a particular volume.

      volume
      The volume in this shape.
      decimal.Decimal
      The inner shape's height in mm with the given volume.
    • width_at_height(self, height : Number) -> decimal.Decimal

      Calculate 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.

      height
      The height within this shape.
      decimal.Decimal
      The width in mm of the cross-section at the given height.
    • depth_at_height(self, height : Number) -> decimal.Decimal

      Calculate 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.

      height
      The height within this shape.
      decimal.Decimal
      The depth in mm of the cross-section at the given height.
    • area_at_height(self, height : Number) -> decimal.Decimal

      Calculate the cross-sectional area of this shape at a given height.

      height
      The height within this shape.
      decimal.Decimal
      The cross-sectional area in mm² at the given height.

    Attributes

    • height
      Decimal = dataclasses.field(default=(Decimal()))
    • max_fitting_volume
      decimal.Decimal = None
      The maximum volume that fits into this shape.
  • SphericalCap

    class

    A 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.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, radius : Decimal) -> None

      height
      radius
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • radius
      Decimal = dataclasses.field(default=(Decimal()))
  • SphericalSegment

    class

    3D 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

    • __init__(
        self,
      ) -> None

      height
      radius_lower
      radius_upper
    • __post_init__(self) -> None

    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • radius_lower
      Decimal = dataclasses.field(default=(Decimal()))
    • radius_upper
      Decimal = dataclasses.field(default=(Decimal()))
  • Stacked

    class

    Composition of multiple solid shapes ordered from top to bottom.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, height : Decimal, sections : list[Shape]) -> None

      height
      sections
      list[Shape]
    • __post_init__(self) -> None

    • section_at_height(self, height : Number) -> tuple[Shape, decimal.Decimal]

      Get 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).

      height
      The height from the bottom of the stacked shape.
      tuple[Shape, decimal.Decimal]
      A tuple of (section, local_height_within_section).
    • @typing.override

      volume_for_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      height_for_volume(self, volume : Number) -> decimal.Decimal

      volume
      decimal.Decimal
    • @typing.override

      width_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      depth_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal
    • @typing.override

      area_at_height(self, height : Number) -> decimal.Decimal

      height
      decimal.Decimal

    Attributes

    • sections
      list[Shape] = dataclasses.field(default_factory=list, metadata={'marshmallow_field': marshmallow.fields.List(ShapeField())})
    • height
      Decimal = dataclasses.field(init=False, default=(Decimal()))
  • Vector

    class

    Represents 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

    Attributes

    • x
      Decimal = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=(Decimal(default=0)))
    • y
      Decimal = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=(Decimal(default=0)))
    • z
      Decimal = dataclasses.field(metadata={'marshmallow_field': DecimalField()}, default=(Decimal(default=0)))
  • AccessGrid

    class

    Chess-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]) -> None

      points
      dict[str | int, AccessPoint]
    • __len__(self) -> int

      int
    • __iter__(self) -> collections.abc.Iterator[str | int]

      collections.abc.Iterator[str | int]
    • __getitem__(self, key : str | int) -> AccessPoint

      key
      str | int

    Attributes

  • AccessPoint

    class

    A pipettable position: a physical hole and its owning container.

    Decorators
    dataclasses.dataclass(frozen=True)

    Methods

    Attributes

  • Pipettable

    class

    Group of Fillable or Fillable-like objects that can be pipetted. Provides a key-addressable grid of access points (Hole:Container mapping).

    Bases
    Group[F]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        children : collections.abc.Sequence[T],
        cols : int,
        rows : int
      ) -> None

      children
      collections.abc.Sequence[T]
      cols
      int = 1
      rows
      int = 1
    • __post_init__(self) -> None

    • @typing.override

      _index(self, key : int | str | slice) -> int | slice

      key
      int | str | slice
      int | slice
    • access_point(self, key : str | int) -> AccessPoint

      Return access point for the given key.

      key
      str | int
    • _get_access_points_for_channels(self, channels : collections.abc.Sequence[int]) -> list[AccessPoint]

      Get the access points addressed by the given channel indices.

      channels
      collections.abc.Sequence[int]
    • 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.

      channels
      collections.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.

      channels
      collections.abc.Sequence[int]
      Zero-based channel indices (0 = A1, 1 = B1, ...).
      list[Container]
      The containers corresponding to the given channels, in order.

    Attributes

    • cols
      int = 1
    • rows
      int = 1
    • _access_grid
      AccessGrid | None = dataclasses.field(default=None, init=False, repr=False)
    • logger
      logging.Logger = None
      Return the logger for this resource.
    • _physical_holes_with_containers
      collections.abc.Sequence[tuple[Hole, Container]] = None
      Return all physical (hole, container) pairs across compartments. Override in subclasses that need a different physical-to-logical mapping.
    • access_grid
      AccessGrid = None
      Return the key-addressable access grid.
    • containers
      list[Container] = None
      Containers for each compartment (child), in order.
  • PipettableTarget

    class

    Protocol for objects that can be pipetted.

    Bases
    typing.Protocol
    Decorators
    typing.runtime_checkable

    Methods

    • get_holes_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Hole]

      Get the physical holes addressed by the given channel indices.

      channels
      collections.abc.Sequence[int]
      list[Hole]
    • get_containers_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Container]

      Get the containers addressed by the given channel indices.

      channels
      collections.abc.Sequence[int]
      list[Container]

    Attributes

    • cols
      int = None
    • rows
      int = None
  • Lid

    class

    Lid for plates.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    Attributes

    • fitting_depth
      Decimal = dataclasses.field(default=(Decimal(default=0.0)))
    • grab_height
      Decimal = dataclasses.field(default=(Decimal(default=0.0)))
  • Plate

    class

    Abstract base class for plate resources.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        lid : Lid | None,
        children : collections.abc.Sequence[T],
        cols : int,
        rows : int,
      ) -> None

      tags
      dict
      lid
      Lid | None = None
      children
      collections.abc.Sequence[T]
      cols
      int = 12
      rows
      int = 8
      grab_height
    • __post_init__(self, *args, **kwargs) -> None

      *args
      = ()
      **kwargs
      = {}
    • @typing.override

      find(self, identifier : str) -> Resource

      identifier
      str
    • __contains__(self, item : object) -> bool

      item
      object
      bool

    Attributes

    • cols
      int = 12
    • rows
      int = 8
    • grab_height
      Decimal = dataclasses.field(default=(Decimal()))
  • Standard96Plate

    class

    Standard 96-well plate.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        lid : Lid | None,
        children : collections.abc.Sequence[Well],
        cols : int,
        rows : int,
      ) -> None

      tags
      dict
      lid
      Lid | None = None
      children
      collections.abc.Sequence[Well]
      cols
      int = 12
      rows
      int = 8
      grab_height

    Attributes

    • cols
      int = 12
    • rows
      int = 8
    • grab_height
      Decimal = dataclasses.field(default=(Decimal(default=13.2)))
    • children
      collections.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

    class

    Standard 384-well plate.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        lid : Lid | None,
        children : collections.abc.Sequence[Well],
        cols : int,
        rows : int,
      ) -> None

      tags
      dict
      lid
      Lid | None = None
      children
      collections.abc.Sequence[Well]
      cols
      int = 24
      rows
      int = 16
      grab_height

    Attributes

    • cols
      int = 24
    • rows
      int = 16
    • grab_height
      Decimal = dataclasses.field(default=(Decimal(default=13.2)))
    • children
      collections.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

    class

    Standard 1536-well plate.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        lid : Lid | None,
        children : collections.abc.Sequence[Well],
        cols : int,
        rows : int,
      ) -> None

      tags
      dict
      lid
      Lid | None = None
      children
      collections.abc.Sequence[Well]
      cols
      int = 48
      rows
      int = 32
      grab_height

    Attributes

    • cols
      int = 48
    • rows
      int = 32
    • grab_height
      Decimal = dataclasses.field(default=(Decimal(default=13.2)))
    • children
      collections.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

    class

    Well of a microtitre plate.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    Attributes

  • ChildrenField

    class

    A 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
      ) -> typing.Any

      value
      typing.Any
      attr
      str
      data
      dict[str, typing.Any]
      partial
      bool | None = None
      **kwargs
      = {}
      typing.Any
  • Instrument

    class

    Specialist equipment to perform work with it, e.g. spectrometer or incubator.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, tags : dict) -> None

      tags
      dict
  • JsonSchema

    class

    The structure used when serializing resources.

    Bases
    typing.TypedDict

    Attributes

    • root
      str = None
    • resources
      dict[str, dict[str, typing.Any]] = None
  • Labware

    class

    All the equipment used in many different types of laboratory.

    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, tags : dict) -> None

      tags
      dict
      Key and value pairs that act as metadata for organizing your labware.

    Attributes

    • tags
      dict = dataclasses.field(default_factory=dict)
  • MissingError

    class

    Raised when a resource was expected but none was found.

    Bases
    RuntimeError
  • OccupiedError

    class

    Raised when a resource is already filling the spot.

    Bases
    RuntimeError
  • Resource

    class

    Base class for labware resources.

    Decorators
    marshmallow_dataclass.dataclass(base_schema=ResourceSchema)

    Methods

    • __post_init__(self, *_kwargs) -> None

      *_kwargs
      = ()
    • __init_subclass__(cls) -> None

    • @classmethod

      labware(cls) -> type[Labware]

      Get the labware this resource is associated with.

      type[Labware]
    • assign_to(self, parent : Group) -> None

      Set the parent of this resource to the given group.

      parent
      The group to which this resource is assigned to.
    • @deprecation.deprecated(deprecated_in='0.1.20', removed_in='0.2.0', current_version=__version__, details='Use `rotate_by` instead.')

      rotate(self, angle : int) -> None

      Rotate clockwise by the given angle in degrees. Use negative numbers for counter clockwise rotation.

      angle
      int
      The angle in degrees to rotate the resource. Must be a multiple of 90°.
    • rotate_by(self, angle : int) -> None

      Rotate clockwise by the given angle in degrees. Use negative numbers for counter clockwise rotation.

      angle
      int
      The angle in degrees to rotate the resource. Must be a multiple of 90°.
    • rotate_to(self, angle : int) -> None

      Rotate to the given absolute angle in degrees.

      angle
      int
      The angle in degrees to rotate the resource. Must be a multiple of 90°.
    • parents(self, root : type[Resource] | None) -> list[tuple[Resource, int]]

      Retrieve the hierarchy of parents for this resource.

      root
      type[Resource] | None = None
      Optionally limit the hierarchy to a specific type of parent.
      list[tuple[Resource, int]]
      The hierarchy of parents for this resource.
    • find(self, identifier : str) -> Resource

      Find a resource by its identifier.

      identifier
      str
      The resource's identifier to search for.
      The resource with the corresponding identifier.
    • __contains__(self, item : object) -> bool

      Check whether a resource is assigned to this resource.

      item
      object
      The resource to search for.
      bool
      True if the resource could be found, False otherwise.
    • copy(self, **changes) -> typing.Self

      Return a copy of this resource.

      **changes
      = {}
      Replace fields with values from `changes`.
      typing.Self
      A copy of this resource.
    • serialize(self) -> JsonSchema

      Serialize this resource as a JSON-like dictionary.

      The JSON-like dictionary with the resource's data.
    • @classmethod

      deserialize(cls, identifier : str, schema : JsonSchema) -> typing.Self

      Deserialize a JSON-like dictionary to a resource.

      identifier
      str
      The identifier of the resource to deserialize.
      The JSON-like dictionary with the resource's data.
      typing.Self
      The newly created resource.
    • @classmethod

      subclass_by_name(cls, name : str) -> type[Resource] | None

      Recursively find a resource subclass with the given name.

      name
      str
      The name of the class to find.
      type[Resource] | None
      The class with the given name, or `None` if no such class exists.

    Attributes

    • identifier
      str = dataclasses.field(default_factory=(lambda: str(uuid.uuid4().hex[:8])))
    • rotation
      int = 0
    • dimensions
      Vector = dataclasses.field(default_factory=Vector)
    • location
      Vector | None = None
    • Schema
      type[marshmallow.Schema] = marshmallow.Schema
    • name
      str = None
      A human readable name to identify resources.
    • index
      int = None
      The index of this resource in its parent.
    • absolute_location
      Vector = None
      The absolute location of this resource.
    • width
      decimal.Decimal = None
      The size of the resource along the x-axis.
    • depth
      decimal.Decimal = None
      The size of the resource along the y-axis.
    • height
      decimal.Decimal = None
      The size of the resource along the z-axis.
    • center
      Vector = None
      The center base of this resource.
  • ResourceSchema

    class

    Schema for serializing and deserializing resources.

    Bases
    marshmallow.Schema

    Attributes

    • TYPE_MAPPING
      typing.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

    class

    A single tip.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
      ) -> None

      tags
      dict
      fitting_depth
      The overlap between the tip and the pipette, in mm.
      container
      blowout_air_volume
      transport_air_volume

    Attributes

    • fitting_depth
      Decimal = dataclasses.field(default=(Decimal()))
    • container
      Container = dataclasses.field(default_factory=Container)
    • blowout_air_volume
      Decimal = dataclasses.field(default=(Decimal()))
    • transport_air_volume
      Decimal = dataclasses.field(default=(Decimal()))
    • total_volume
      decimal.Decimal = None
      The total volume of liquid in the tip.
    • free_volume
      decimal.Decimal = None
      The freely available volume in µl in the tip.
  • TipRack

    class

    Tip racks are the source for providing pipettes with disposable or reusable tips.

    MRO
    Bases
    Rack[TipSpot[T], T],
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[S],
        filled_with : dataclasses.InitVar[None | T | type[T]],
        filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None],
        cols : int,
        rows : int
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[S]
      filled_with
      dataclasses.InitVar[None | T | type[T]] = None
      The type of tips this rack is filled with.
      filled_at
      dataclasses.InitVar[collections.abc.Sequence[int | str] | None] = None
      Indices in which spots to fill the labware. Defaults to all spots.
      cols
      int = 12
      The number of tips in the x direction.
      rows
      int = 8
      The number of tips in the y direction.
    • @log()

      next_tips(self, count : int) -> list[TipSpot]

      Get the next available tip spot that is filled with a tip.

      count
      int = 1
      list[TipSpot]
      The tip spot of the first available tip.
    • @log()

      first_spots(self, count : int) -> list[TipSpot]

      Get the first available tip spot that is empty.

      count
      int = 1
      list[TipSpot]
      The tip spot of the first empty spot.
    • @typing.override

      _index(self, key : int | str | slice) -> int | slice

      key
      int | str | slice
      int | slice

    Attributes

    • cols
      int = 12
    • rows
      int = 8
    • RACK_DIMENSIONS
      Vector = Vector()
    • logger
      logging.Logger = None
      Logger for this tip rack.
  • TipSpot

    class

    Optionally hold a tip at a predefined location on a tip rack.

    MRO
    Bases
    Spot[T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, children : collections.abc.Sequence[T]) -> None

      children
      collections.abc.Sequence[T]
    • @typing.override

      can_assign(
        self,
        resource : Tip,
        **kwargs
      ) -> typing.TypeGuard[T]

      resource
      **kwargs
      = {}
      typing.TypeGuard[T]
    • @typing.override

      assign(
        self,
        resource : Tip | None,
        **kwargs
      ) -> None

      resource
      Tip | None
      **kwargs
      = {}
  • StandardTrough

    class

    A standard trough.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[Fillable],
        cols : int,
        rows : int,
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[Fillable]
      cols
      int = 12
      rows
      int = 8
      dimensions

    Attributes

    • cols
      int = 12
    • rows
      int = 8
    • dimensions
      Vector = dataclasses.field(default_factory=(lambda: Vector(z=44)))
    • children
      collections.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

    class

    An 8-row trough with 96 holes for simultaneous pipetting operations.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[Fillable],
        cols : int,
        rows : int,
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[Fillable]
      cols
      int = 12
      rows
      int = 8
      dimensions

    Attributes

    • cols
      int = 12
    • rows
      int = 8
    • dimensions
      Vector = dataclasses.field(default_factory=(lambda: Vector(z=44)))
    • children
      collections.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

    class

    A 12-column trough with 96 holes for simultaneous pipetting operations.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[Fillable],
        cols : int,
        rows : int,
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[Fillable]
      cols
      int = 12
      rows
      int = 8
      dimensions

    Attributes

    • cols
      int = 12
    • rows
      int = 8
    • dimensions
      Vector = dataclasses.field(default_factory=(lambda: Vector(z=44)))
    • children
      collections.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

    class

    A trough with one or more Fillable compartments. Each child Fillable represents one independent liquid body (compartment).

    MRO
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[T],
        cols : int,
        rows : int
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[T]
      cols
      int = 1
      rows
      int = 1
  • Cap

    class

    Cap for tubes.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

  • Standard96TubeRack

    class

    TubeRack of standard dimensions, with 12 columns and 8 rows. Automatically creates 96 tube spots with ANSI SLAS spot dimensions using the `spot_offset`.

    MRO
    Bases
    TubeRack[T],
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[S],
        filled_with : dataclasses.InitVar[None | T | type[T]],
        filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None],
        cols : int,
        rows : int,
        fitting_depth : decimal.Decimal,
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[S]
      filled_with
      dataclasses.InitVar[None | T | type[T]] = None
      The type of tubes this rack is filled with. Defaults to None.
      filled_at
      dataclasses.InitVar[collections.abc.Sequence[int | str] | None] = None
      Indices in which spots to fill the labware. Defaults to all spots.
      cols
      int = 6
      rows
      int = 4
      fitting_depth
      decimal.Decimal
      How far in Z tubes fit into the rack, in mm. Defaults to the TubeRack Z dimension, i.e. tubes fit all the way to the very bottom.
      dimensions
      spot_offset
      X/Y offset to A1 of the rack, in mm. Defaults to Vector(x=4.5, y=4.5). Z must be 0.
    • __post_init__(
        self,
        filled_with : None | T | type[T],
        filled_at : collections.abc.Sequence[int | str] | None,
        *kwargs
      ) -> None

      filled_with
      None | T | type[T]
      filled_at
      collections.abc.Sequence[int | str] | None
      *kwargs
      = ()
    • _check_children(self) -> None

      Check that all children with locations fit within the rack dimensions.

    Attributes

    • cols
      int = 12
    • rows
      int = 8
    • dimensions
      Vector = dataclasses.field(default_factory=(lambda: Vector(z=40)))
    • fitting_depth
      decimal.Decimal = decimal.Decimal('38')
    • spot_offset
      Vector = dataclasses.field(default_factory=(lambda: Vector(x=4.5, y=4.5)))
    • children
      collections.abc.Sequence[TubeSpot[T]] = dataclasses.field(repr=False, default_factory=list, init=False)
  • Tube

    class

    A tube.

    MRO
    • └──── Tube
    Decorators
    dataclasses.dataclass

    Methods

    Attributes

    • lid
      Cap | None = dataclasses.field(repr=False, default=None)
    • shape
      FillableShape = FillableShape.CIRCLE
    • bottom_type
      FillableBottomType = FillableBottomType.FLAT
    • label
      str = None
      Label of the tube, e.g. A1 or H8.
  • TubeRack

    class

    Base class for tube racks.

    MRO
    Bases
    Rack[TubeSpot[T], T],
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(
        self,
        tags : dict,
        children : collections.abc.Sequence[S],
        filled_with : dataclasses.InitVar[None | T | type[T]],
        filled_at : dataclasses.InitVar[collections.abc.Sequence[int | str] | None],
        cols : int,
        rows : int,
        fitting_depth : decimal.Decimal | None
      ) -> None

      tags
      dict
      children
      collections.abc.Sequence[S]
      filled_with
      dataclasses.InitVar[None | T | type[T]] = None
      The type of tubes this rack is filled with. Defaults to None.
      filled_at
      dataclasses.InitVar[collections.abc.Sequence[int | str] | None] = None
      Indices in which spots to fill the labware. Defaults to all spots.
      cols
      int = 6
      The number of tubes in the X direction. Defaults to 6.
      rows
      int = 4
      The number of tubes in the Y direction. Defaults to 4.
      fitting_depth
      decimal.Decimal | None = None
      How far in Z tubes fit into the rack, in mm. Defaults to the TubeRack Z dimension, i.e. tubes fit all the way to the very bottom.
    • __post_init__(
        self,
        filled_with : None | T | type[T],
        filled_at : collections.abc.Sequence[int | str] | None,
        *kwargs
      ) -> None

      filled_with
      None | T | type[T]
      filled_at
      collections.abc.Sequence[int | str] | None
      *kwargs
      = ()
    • @typing.override

      _index(self, key : int | str | slice) -> int | slice

      key
      int | str | slice
      int | slice
    • get_holes_for_channels(self, channels : collections.abc.Sequence[int]) -> list[Hole]

      Return holes for the given channel indices. Collects holes from occupied tubes in order. Raises IndexError if any channel index is out of range.

      channels
      collections.abc.Sequence[int]
      list[Hole]
    • get_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.

      channels
      collections.abc.Sequence[int]
      list[Container]

    Attributes

    • cols
      int = 6
    • rows
      int = 4
    • fitting_depth
      decimal.Decimal | None = None
    • containers
      list[Container] = None
      Return containers from all tubes in the rack.
    • height
      decimal.Decimal = None
      Return the height of the tube rack. The height is the maximum of the height of the tube rack and the sum of the tube rack and tube heights, minus the fitting depth.
    • tubes
      RackContents[T] = None
      Return all tubes in the tube rack.
    • any_caps
      bool = None
      Get whether any of the tubes in the rack have caps.
  • TubeSpot

    class

    Optionally hold a tube at a predefined location on a tube rack.

    MRO
    Bases
    Spot[T]
    Decorators
    dataclasses.dataclass

    Methods

    • __init__(self, children : collections.abc.Sequence[T]) -> None

      children
      collections.abc.Sequence[T]
    • @typing.override

      can_assign(
        self,
        **kwargs
      ) -> typing.TypeGuard[T]

      resource
      **kwargs
      = {}
      typing.TypeGuard[T]
    • @typing.override

      assign(
        self,
        **kwargs
      ) -> None

      resource
      **kwargs
      = {}
  • LabwareEncoder

    class

    JSON encoder for labware objects.

    Bases
    json.JSONEncoder

    Methods

    • @typing.override

      default(self, o : object) -> typing.Any

      Encode a labware object.

      o
      object
      typing.Any
  • Level

    class

    Logging 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

    class

    Sentinel object to detect if a parameter is supplied or not.

    Methods

    • __repr__(self) -> str

      str
  • Serializable

    class

    Serialize this class into its json representation and back.

    Bases
    typing.Protocol

    Methods

    • serialize(self) -> list[typing.Any] | dict[str, typing.Any]

      Serialize this class into its json representation.

      list[typing.Any] | dict[str, typing.Any]
      The json representation of this class.
    • @classmethod

      deserialize(cls, value : list[typing.Any] | dict[str, typing.Any]) -> typing.Self

      Deserialize the json representation into this class.

      value
      list[typing.Any] | dict[str, typing.Any]
      The json representation to deserialize.
      typing.Self
      The deserialized instance of this class.