unitelabs.labware.groups

Packages

Attributes

  • Name
    __all__
    Type
    Value

    = [ "Group", "Stack", "Rack", "Spot", "Deck", "Trash", "UnassignedError" ]

    Description

Classes

  • Deck

    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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        children
        Type
        collections.abc.Sequence[T]
        Default
        Description

    • get(self, identifier : str) -> Labware

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The labware's identifier.

      Response

      Type
      Labware
      Description

      The labware with the given identifier.

    • @log()

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

      Add the labware to this deck.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        labware
        Type
        Labware
        Default
        Description

        The labware to add to the deck.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the liquid handler.

    • @log()

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

      Remove the labware from this deck.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        labware
        Type
        Labware
        Default
        Description

        The labware to remove from the deck.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        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.

      Response

      Type
      str
      Description

      The deck layout summary.

    • can_assign(
        self,
        location : typing.Optional[Vector],
        **kwargs
      ) -> typing_extensions.TypeGuard[T]

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Labware
        Default
        Description

        The resource to assign to this deck.

      • Name
        location
        Type
        typing.Optional[Vector]
        Default
        = None
        Description

        The location where to place the resource relative to the deck's origin.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the deck.

      Response

      Type
      typing_extensions.TypeGuard[T]
      Description

      True if the resource can be assigned, otherwise raise an error.

    • assign(
        self,
        location : typing.Optional[Vector],
        **kwargs
      ) -> None

      Assign the given resource to this deck.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Labware
        Default
        Description

        The resource to assign to this deck.

      • Name
        location
        Type
        typing.Optional[Vector]
        Default
        = None
        Description

        The location where to place the resource relative to the deck's origin.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the deck.

    • can_unassign(
        self,
        **kwargs
      ) -> typing_extensions.TypeGuard[T]

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Labware
        Default
        Description

        The resource to unassign from this deck.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the deck.

      Response

      Type
      typing_extensions.TypeGuard[T]
      Description

      True if the resource can be unassigned, otherwise raise an error.

    • unassign(
        self,
        **kwargs
      ) -> None

      Unassign the given resource from this deck.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Labware
        Default
        Description

        The resource to unassign from this deck.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the deck.

    • __post_init__(self, *kwargs) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        *kwargs
        Type
        Default
        = ()
        Description

    • __init_subclass__(cls) -> None

      Parameters

      • Name
        cls
        Type
        Default
        Description

    • @typing_extensions.override

      rotate_by(self, angle : int) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • find(self, identifier) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        identifier
        Type
        Default
        Description

    • __contains__(self, item : typing.Any) -> bool

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        item
        Type
        typing.Any
        Default
        Description

      Response

      Type
      bool
      Description

    • __getitem__(self, key : typing.Union[int, str, slice]) -> typing.Union[T, collections.abc.Sequence[T]]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[T, collections.abc.Sequence[T]]
      Description

    • __len__(self) -> int

      The number of children in this group.

      Response

      Type
      int
      Description

      The number of children in this group.

    • __iter__(self) -> collections.abc.Iterator[T]

      Iterate over the children of this group.

      Response

      Type
      collections.abc.Iterator[T]
      Description

      An iterator to iterate over all children in this group.

    • _index(self, key : typing.Union[int, str, slice]) -> typing.Union[int, slice]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[int, slice]
      Description

    • copy(self, **changes) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        **changes
        Type
        Default
        = {}
        Description

    • serialize(self) -> JsonSchema

      Response

      Type
      JsonSchema
      Description

    • assign_to(self, parent : Group) -> None

      Set the parent of this resource to the given group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        parent
        Type
        Group
        Default
        Description

        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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • rotate_to(self, angle : int) -> None

      Rotate to the given absolute angle in degrees.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

        The angle in degrees to rotate the resource. Must be a multiple of 90°.

    • @classmethod

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

      Deserialize a JSON-like dictionary to a resource.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The identifier of the resource to deserialize.

      • Name
        schema
        Type
        JsonSchema
        Default
        Description

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

      Response

      Type
      typing_extensions.Self
      Description

      The newly created resource.

    • @classmethod

      subclass_by_name(cls, name : str) -> typing.Optional[type[Resource]]

      Recursively find a resource subclass with the given name.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        name
        Type
        str
        Default
        Description

        The name of the class to find.

      Response

      Type
      typing.Optional[type[Resource]]
      Description

      The class with the given name, or `None` if no such class exists.

      Exceptions

      Type
      TypeError
      Description
      If the name is not a valid class name.

    Attributes

    • Name
      logger
      Type
      logging.Logger
      Value

      = None

      Description

    • Name
      children
      Type
      collections.abc.Sequence[T]
      Value

      = dataclasses.field(metadata={'marshmallow_field': marshmallow.fields.List(ChildrenField(Resource.Schema(), 'identifier'))}, repr=False, default_factory=list)

      Description

    • Name
      identifier
      Type
      str
      Value

      = dataclasses.field(default_factory=lambda: str(uuid.uuid4().hex[:8]))

      Description

    • Name
      rotation
      Type
      int
      Value

      = 0

      Description

    • Name
      dimensions
      Type
      Vector
      Value

      = dataclasses.field(default_factory=Vector)

      Description

    • Name
      location
      Type
      typing.Optional[Vector]
      Value

      = None

      Description

    • Name
      Schema
      Type
      type[marshmallow.Schema]
      Value

      = marshmallow.Schema

      Description

    • Name
      name
      Type
      str
      Value

      = None

      Description

      A human readable name to identify resources.

    • Name
      absolute_location
      Type
      Vector
      Value

      = None

      Description

      The absolute location of this resource.

    • Name
      width
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the x-axis.

    • Name
      depth
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the y-axis.

    • Name
      height
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the z-axis.

    • Name
      center
      Type
      Vector
      Value

      = None

      Description

      The center base of this resource.

  • Group

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

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

    Methods

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        children
        Type
        collections.abc.Sequence[T]
        Default
        Description

    • __post_init__(self, *kwargs) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        *kwargs
        Type
        Default
        = ()
        Description

    • __init_subclass__(cls) -> None

      Parameters

      • Name
        cls
        Type
        Default
        Description

    • @typing_extensions.override

      rotate_by(self, angle : int) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • find(self, identifier) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        identifier
        Type
        Default
        Description

    • __contains__(self, item : typing.Any) -> bool

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        item
        Type
        typing.Any
        Default
        Description

      Response

      Type
      bool
      Description

    • __getitem__(self, key : typing.Union[int, str, slice]) -> typing.Union[T, collections.abc.Sequence[T]]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[T, collections.abc.Sequence[T]]
      Description

    • __len__(self) -> int

      The number of children in this group.

      Response

      Type
      int
      Description

      The number of children in this group.

    • __iter__(self) -> collections.abc.Iterator[T]

      Iterate over the children of this group.

      Response

      Type
      collections.abc.Iterator[T]
      Description

      An iterator to iterate over all children in this group.

    • _index(self, key : typing.Union[int, str, slice]) -> typing.Union[int, slice]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[int, slice]
      Description

    • copy(self, **changes) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        **changes
        Type
        Default
        = {}
        Description

    • serialize(self) -> JsonSchema

      Response

      Type
      JsonSchema
      Description

    • assign_to(self, parent : Group) -> None

      Set the parent of this resource to the given group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        parent
        Type
        Group
        Default
        Description

        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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • rotate_to(self, angle : int) -> None

      Rotate to the given absolute angle in degrees.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

        The angle in degrees to rotate the resource. Must be a multiple of 90°.

    • @classmethod

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

      Deserialize a JSON-like dictionary to a resource.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The identifier of the resource to deserialize.

      • Name
        schema
        Type
        JsonSchema
        Default
        Description

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

      Response

      Type
      typing_extensions.Self
      Description

      The newly created resource.

    • @classmethod

      subclass_by_name(cls, name : str) -> typing.Optional[type[Resource]]

      Recursively find a resource subclass with the given name.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        name
        Type
        str
        Default
        Description

        The name of the class to find.

      Response

      Type
      typing.Optional[type[Resource]]
      Description

      The class with the given name, or `None` if no such class exists.

      Exceptions

      Type
      TypeError
      Description
      If the name is not a valid class name.

    Attributes

    • Name
      children
      Type
      collections.abc.Sequence[T]
      Value

      = dataclasses.field(metadata={'marshmallow_field': marshmallow.fields.List(ChildrenField(Resource.Schema(), 'identifier'))}, repr=False, default_factory=list)

      Description

    • Name
      identifier
      Type
      str
      Value

      = dataclasses.field(default_factory=lambda: str(uuid.uuid4().hex[:8]))

      Description

    • Name
      rotation
      Type
      int
      Value

      = 0

      Description

    • Name
      dimensions
      Type
      Vector
      Value

      = dataclasses.field(default_factory=Vector)

      Description

    • Name
      location
      Type
      typing.Optional[Vector]
      Value

      = None

      Description

    • Name
      Schema
      Type
      type[marshmallow.Schema]
      Value

      = marshmallow.Schema

      Description

    • Name
      name
      Type
      str
      Value

      = None

      Description

      A human readable name to identify resources.

    • Name
      absolute_location
      Type
      Vector
      Value

      = None

      Description

      The absolute location of this resource.

    • Name
      width
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the x-axis.

    • Name
      depth
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the y-axis.

    • Name
      height
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the z-axis.

    • Name
      center
      Type
      Vector
      Value

      = None

      Description

      The center base of this resource.

  • Rack

    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[typing.Union[None, T, type[T]]],
        filled_at : dataclasses.InitVar[typing.Optional[collections.abc.Sequence[typing.SupportsIndex]]]
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        children
        Type
        collections.abc.Sequence[S]
        Default
        Description

      • Name
        filled_with
        Type
        dataclasses.InitVar[typing.Union[None, T, type[T]]]
        Default
        = None
        Description

        The type of labware this rack is filled with.

      • Name
        filled_at
        Type
        dataclasses.InitVar[typing.Optional[collections.abc.Sequence[typing.SupportsIndex]]]
        Default
        = None
        Description

        Indices in which spots to fill the labware. Defaults to all spots.

    • __post_init__(
        self,
        filled_with : typing.Union[None, T, type[T]],
        filled_at : typing.Optional[collections.abc.Sequence[typing.SupportsIndex]],
        *kwargs
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        filled_with
        Type
        typing.Union[None, T, type[T]]
        Default
        Description

      • Name
        filled_at
        Type
        typing.Optional[collections.abc.Sequence[typing.SupportsIndex]]
        Default
        Description

      • Name
        *kwargs
        Type
        Default
        = ()
        Description

    • get(self, key : typing.Union[int, str]) -> typing.Optional[T]

      Access the labware in the spot at the given key.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str]
        Default
        Description

        The key of the spot from which to access the labware.

      Response

      Type
      typing.Optional[T]
      Description

    • @log()

      add(self, labware : T, key : typing.Union[int, str]) -> None

      Add labware to the spot at the given key.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        labware
        Type
        T
        Default
        Description

        The labware to add to the spot.

      • Name
        key
        Type
        typing.Union[int, str]
        Default
        Description

        The key of the spot where to add the labware.

    • @log()

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

      Fill the spots of the rack with the given labware.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        labware
        Type
        typing.Union[T, type[T], collections.abc.Sequence[T]]
        Default
        Description

        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.

      • Name
        spots
        Type
        typing.Optional[collections.abc.Sequence[Spot[T]]]
        Default
        = None
        Description

        The spots in which to assign the labware.

    • @log()

      remove(self, key : typing.Union[int, str]) -> typing.Optional[T]

      Remove labware from the spot at the given key.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str]
        Default
        Description

        The key of the spot from where to remove the labware.

      Response

      Type
      typing.Optional[T]
      Description

      The labware that was removed, if any.

    • @log()

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

      Clear the spots of the rack.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        spots
        Type
        typing.Optional[collections.abc.Sequence[Spot[T]]]
        Default
        = None
        Description

        The spots from which to unassign the labware.

      Response

      Type
      collections.abc.Sequence[typing.Optional[T]]
      Description

      The list of labware that was removed, if any.

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      • Name
        value
        Type
        typing.Union[typing.Optional[T], collections.abc.Sequence[typing.Optional[T]]]
        Default
        Description

    • __delitem__(self, key : typing.Union[int, str, slice]) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

    • __init_subclass__(cls) -> None

      Parameters

      • Name
        cls
        Type
        Default
        Description

    • @typing_extensions.override

      rotate_by(self, angle : int) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • find(self, identifier) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        identifier
        Type
        Default
        Description

    • __contains__(self, item : typing.Any) -> bool

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        item
        Type
        typing.Any
        Default
        Description

      Response

      Type
      bool
      Description

    • __getitem__(self, key : typing.Union[int, str, slice]) -> typing.Union[T, collections.abc.Sequence[T]]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[T, collections.abc.Sequence[T]]
      Description

    • __len__(self) -> int

      The number of children in this group.

      Response

      Type
      int
      Description

      The number of children in this group.

    • __iter__(self) -> collections.abc.Iterator[T]

      Iterate over the children of this group.

      Response

      Type
      collections.abc.Iterator[T]
      Description

      An iterator to iterate over all children in this group.

    • _index(self, key : typing.Union[int, str, slice]) -> typing.Union[int, slice]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[int, slice]
      Description

    • copy(self, **changes) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        **changes
        Type
        Default
        = {}
        Description

    • serialize(self) -> JsonSchema

      Response

      Type
      JsonSchema
      Description

    • assign_to(self, parent : Group) -> None

      Set the parent of this resource to the given group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        parent
        Type
        Group
        Default
        Description

        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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • rotate_to(self, angle : int) -> None

      Rotate to the given absolute angle in degrees.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

        The angle in degrees to rotate the resource. Must be a multiple of 90°.

    • @classmethod

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

      Deserialize a JSON-like dictionary to a resource.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The identifier of the resource to deserialize.

      • Name
        schema
        Type
        JsonSchema
        Default
        Description

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

      Response

      Type
      typing_extensions.Self
      Description

      The newly created resource.

    • @classmethod

      subclass_by_name(cls, name : str) -> typing.Optional[type[Resource]]

      Recursively find a resource subclass with the given name.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        name
        Type
        str
        Default
        Description

        The name of the class to find.

      Response

      Type
      typing.Optional[type[Resource]]
      Description

      The class with the given name, or `None` if no such class exists.

      Exceptions

      Type
      TypeError
      Description
      If the name is not a valid class name.

    Attributes

    • Name
      children
      Type
      collections.abc.Sequence[S]
      Value

      = dataclasses.field(repr=False, default_factory=list)

      Description

    • Name
      logger
      Type
      logging.Logger
      Value

      = None

      Description

    • Name
      identifier
      Type
      str
      Value

      = dataclasses.field(default_factory=lambda: str(uuid.uuid4().hex[:8]))

      Description

    • Name
      rotation
      Type
      int
      Value

      = 0

      Description

    • Name
      dimensions
      Type
      Vector
      Value

      = dataclasses.field(default_factory=Vector)

      Description

    • Name
      location
      Type
      typing.Optional[Vector]
      Value

      = None

      Description

    • Name
      Schema
      Type
      type[marshmallow.Schema]
      Value

      = marshmallow.Schema

      Description

    • Name
      name
      Type
      str
      Value

      = None

      Description

      A human readable name to identify resources.

    • Name
      absolute_location
      Type
      Vector
      Value

      = None

      Description

      The absolute location of this resource.

    • Name
      width
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the x-axis.

    • Name
      depth
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the y-axis.

    • Name
      height
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the z-axis.

    • Name
      center
      Type
      Vector
      Value

      = None

      Description

      The center base of this resource.

  • Spot

    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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        children
        Type
        collections.abc.Sequence[T]
        Default
        Description

    • get(self) -> typing.Optional[T]

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

      Response

      Type
      typing.Optional[T]
      Description

    • add(self, labware : typing.Optional[T]) -> None

      Assign the labware to this spot.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        labware
        Type
        typing.Optional[T]
        Default
        Description

        The labware to assign.

    • remove(self) -> typing.Optional[T]

      Remove the resource in this spot.

      Response

      Type
      typing.Optional[T]
      Description

      The resource that was removed from this spot, if available.

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

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        typing.Optional[Resource]
        Default
        Description

        The resource to assign to this group.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the group.

      Response

      Type
      typing_extensions.TypeGuard[T]
      Description

      True if the resource can be assigned, otherwise raise an error.

    • assign(
        self,
        **kwargs
      ) -> None

      Assign the given resource to this group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        typing.Optional[Resource]
        Default
        Description

        The resource to assign to this group.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the group.

    • can_unassign(
        self,
        **kwargs
      ) -> typing_extensions.TypeGuard[T]

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        typing.Optional[Resource]
        Default
        = None
        Description

        The resource to unassign from this group.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the group.

      Response

      Type
      typing_extensions.TypeGuard[T]
      Description

      True if the resource can be unassigned, otherwise raise an error.

    • unassign(
        self,
        **kwargs
      ) -> None

      Unassign the given resource from this group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        typing.Optional[Resource]
        Default
        = None
        Description

        The resource to unassign from this group.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the group.

    • reassign(
        self,
        **kwargs
      ) -> None

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        to
        Type
        Spot
        Default
        Description

        The target group to which to assign the resource to.

      • Name
        resource
        Type
        typing.Optional[Resource]
        Default
        = None
        Description

        The resource to reassign from this group to the other one.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the group.

    • __post_init__(self, *kwargs) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        *kwargs
        Type
        Default
        = ()
        Description

    • __init_subclass__(cls) -> None

      Parameters

      • Name
        cls
        Type
        Default
        Description

    • @typing_extensions.override

      rotate_by(self, angle : int) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • find(self, identifier) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        identifier
        Type
        Default
        Description

    • __contains__(self, item : typing.Any) -> bool

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        item
        Type
        typing.Any
        Default
        Description

      Response

      Type
      bool
      Description

    • __getitem__(self, key : typing.Union[int, str, slice]) -> typing.Union[T, collections.abc.Sequence[T]]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[T, collections.abc.Sequence[T]]
      Description

    • __len__(self) -> int

      The number of children in this group.

      Response

      Type
      int
      Description

      The number of children in this group.

    • __iter__(self) -> collections.abc.Iterator[T]

      Iterate over the children of this group.

      Response

      Type
      collections.abc.Iterator[T]
      Description

      An iterator to iterate over all children in this group.

    • _index(self, key : typing.Union[int, str, slice]) -> typing.Union[int, slice]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[int, slice]
      Description

    • copy(self, **changes) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        **changes
        Type
        Default
        = {}
        Description

    • serialize(self) -> JsonSchema

      Response

      Type
      JsonSchema
      Description

    • assign_to(self, parent : Group) -> None

      Set the parent of this resource to the given group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        parent
        Type
        Group
        Default
        Description

        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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • rotate_to(self, angle : int) -> None

      Rotate to the given absolute angle in degrees.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

        The angle in degrees to rotate the resource. Must be a multiple of 90°.

    • @classmethod

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

      Deserialize a JSON-like dictionary to a resource.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The identifier of the resource to deserialize.

      • Name
        schema
        Type
        JsonSchema
        Default
        Description

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

      Response

      Type
      typing_extensions.Self
      Description

      The newly created resource.

    • @classmethod

      subclass_by_name(cls, name : str) -> typing.Optional[type[Resource]]

      Recursively find a resource subclass with the given name.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        name
        Type
        str
        Default
        Description

        The name of the class to find.

      Response

      Type
      typing.Optional[type[Resource]]
      Description

      The class with the given name, or `None` if no such class exists.

      Exceptions

      Type
      TypeError
      Description
      If the name is not a valid class name.

    Attributes

    • Name
      children
      Type
      collections.abc.Sequence[typing.Optional[T]]
      Value

      = dataclasses.field(init=False, repr=False, default_factory=lambda: [None])

      Description

    • Name
      child
      Type
      typing.Optional[T]
      Value

      = None

      Description

      Request the resource in this spot or `None` if the spot is empty.

    • Name
      identifier
      Type
      str
      Value

      = dataclasses.field(default_factory=lambda: str(uuid.uuid4().hex[:8]))

      Description

    • Name
      rotation
      Type
      int
      Value

      = 0

      Description

    • Name
      dimensions
      Type
      Vector
      Value

      = dataclasses.field(default_factory=Vector)

      Description

    • Name
      location
      Type
      typing.Optional[Vector]
      Value

      = None

      Description

    • Name
      Schema
      Type
      type[marshmallow.Schema]
      Value

      = marshmallow.Schema

      Description

    • Name
      name
      Type
      str
      Value

      = None

      Description

      A human readable name to identify resources.

    • Name
      absolute_location
      Type
      Vector
      Value

      = None

      Description

      The absolute location of this resource.

    • Name
      width
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the x-axis.

    • Name
      depth
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the y-axis.

    • Name
      height
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the z-axis.

    • Name
      center
      Type
      Vector
      Value

      = None

      Description

      The center base of this resource.

  • Stack

    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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        children
        Type
        collections.abc.Sequence[T]
        Default
        Description

      • Name
        direction
        Type
        typing.Literal['x', 'y', 'z']
        Default
        = 'z'
        Description

        The direction in which to stack resources.

    • can_assign(
        self,
        location : typing.Optional[Vector],
        **kwargs
      ) -> typing_extensions.TypeGuard[T]

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Resource
        Default
        Description

        The resource to assign to this deck.

      • Name
        location
        Type
        typing.Optional[Vector]
        Default
        = None
        Description

        The location where to place the resource relative to the deck's origin.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the deck.

      Response

      Type
      typing_extensions.TypeGuard[T]
      Description

      True if the resource can be assigned, otherwise raise an error.

    • assign(
        self,
        location : typing.Optional[Vector],
        **kwargs
      ) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Resource
        Default
        Description

      • Name
        location
        Type
        typing.Optional[Vector]
        Default
        = None
        Description

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

    • can_unassign(
        self,
        **kwargs
      ) -> bool

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Resource
        Default
        Description

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

      Response

      Type
      bool
      Description

    • unassign(
        self,
        **kwargs
      ) -> None

      Unassign the given resource from this deck.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        resource
        Type
        Resource
        Default
        Description

        The resource to unassign from this deck.

      • Name
        **kwargs
        Type
        Default
        = {}
        Description

        Additional arguments for the deck.

    • __post_init__(self, *kwargs) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        *kwargs
        Type
        Default
        = ()
        Description

    • __init_subclass__(cls) -> None

      Parameters

      • Name
        cls
        Type
        Default
        Description

    • @typing_extensions.override

      rotate_by(self, angle : int) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • find(self, identifier) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        identifier
        Type
        Default
        Description

    • __contains__(self, item : typing.Any) -> bool

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        item
        Type
        typing.Any
        Default
        Description

      Response

      Type
      bool
      Description

    • __getitem__(self, key : typing.Union[int, str, slice]) -> typing.Union[T, collections.abc.Sequence[T]]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[T, collections.abc.Sequence[T]]
      Description

    • __len__(self) -> int

      The number of children in this group.

      Response

      Type
      int
      Description

      The number of children in this group.

    • __iter__(self) -> collections.abc.Iterator[T]

      Iterate over the children of this group.

      Response

      Type
      collections.abc.Iterator[T]
      Description

      An iterator to iterate over all children in this group.

    • _index(self, key : typing.Union[int, str, slice]) -> typing.Union[int, slice]

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        key
        Type
        typing.Union[int, str, slice]
        Default
        Description

      Response

      Type
      typing.Union[int, slice]
      Description

    • copy(self, **changes) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        **changes
        Type
        Default
        = {}
        Description

    • serialize(self) -> JsonSchema

      Response

      Type
      JsonSchema
      Description

    • assign_to(self, parent : Group) -> None

      Set the parent of this resource to the given group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        parent
        Type
        Group
        Default
        Description

        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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • rotate_to(self, angle : int) -> None

      Rotate to the given absolute angle in degrees.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

        The angle in degrees to rotate the resource. Must be a multiple of 90°.

    • @classmethod

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

      Deserialize a JSON-like dictionary to a resource.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The identifier of the resource to deserialize.

      • Name
        schema
        Type
        JsonSchema
        Default
        Description

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

      Response

      Type
      typing_extensions.Self
      Description

      The newly created resource.

    • @classmethod

      subclass_by_name(cls, name : str) -> typing.Optional[type[Resource]]

      Recursively find a resource subclass with the given name.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        name
        Type
        str
        Default
        Description

        The name of the class to find.

      Response

      Type
      typing.Optional[type[Resource]]
      Description

      The class with the given name, or `None` if no such class exists.

      Exceptions

      Type
      TypeError
      Description
      If the name is not a valid class name.

    Attributes

    • Name
      direction
      Type
      typing.Literal['x', 'y', 'z']
      Value

      = 'z'

      Description

    • Name
      width
      Type
      Value

      = None

      Description

    • Name
      depth
      Type
      Value

      = None

      Description

    • Name
      height
      Type
      Value

      = None

      Description

    • Name
      children
      Type
      collections.abc.Sequence[T]
      Value

      = dataclasses.field(metadata={'marshmallow_field': marshmallow.fields.List(ChildrenField(Resource.Schema(), 'identifier'))}, repr=False, default_factory=list)

      Description

    • Name
      identifier
      Type
      str
      Value

      = dataclasses.field(default_factory=lambda: str(uuid.uuid4().hex[:8]))

      Description

    • Name
      rotation
      Type
      int
      Value

      = 0

      Description

    • Name
      dimensions
      Type
      Vector
      Value

      = dataclasses.field(default_factory=Vector)

      Description

    • Name
      location
      Type
      typing.Optional[Vector]
      Value

      = None

      Description

    • Name
      Schema
      Type
      type[marshmallow.Schema]
      Value

      = marshmallow.Schema

      Description

    • Name
      name
      Type
      str
      Value

      = None

      Description

      A human readable name to identify resources.

    • Name
      absolute_location
      Type
      Vector
      Value

      = None

      Description

      The absolute location of this resource.

    • Name
      center
      Type
      Vector
      Value

      = None

      Description

      The center base of this resource.

  • Trash

    Trash area.

    MRO
    Decorators
    dataclasses.dataclass

    Methods

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        name
        Type
        str
        Default
        = 'Trash'
        Description

    • __post_init__(self, *_kwargs) -> None

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        *_kwargs
        Type
        Default
        = ()
        Description

    • __init_subclass__(cls) -> None

      Parameters

      • Name
        cls
        Type
        Default
        Description

    • assign_to(self, parent : Group) -> None

      Set the parent of this resource to the given group.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        parent
        Type
        Group
        Default
        Description

        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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

    • rotate_by(self, angle : int) -> None

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

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

        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.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        angle
        Type
        int
        Default
        Description

        The angle in degrees to rotate the resource. Must be a multiple of 90°.

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

      Find a resource by its identifier.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The resource's identifier to search for.

      Response

      Type
      Resource
      Description

      The resource with the corresponding identifier.

      Exceptions

      Type
      TypeError
      Description
      If the identifier is a non string value.
      Type
      MissingResourceError
      Description
      If the resource could not be found.
    • __contains__(self, item : typing.Any) -> bool

      Check whether a resource is assigned to this resource.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        item
        Type
        typing.Any
        Default
        Description

        The resource to search for.

      Response

      Type
      bool
      Description

      True if the resource could be found, False otherwise.

    • copy(self, **changes) -> typing_extensions.Self

      Return a copy of this resource.

      Parameters

      • Name
        self
        Type
        Default
        Description

      • Name
        **changes
        Type
        Default
        = {}
        Description

        Replace fields with values from `changes`.

      Response

      Type
      typing_extensions.Self
      Description

      A copy of this resource.

    • serialize(self) -> JsonSchema

      Serialize this resource as a JSON-like dictionary.

      Response

      Type
      JsonSchema
      Description

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

    • @classmethod

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

      Deserialize a JSON-like dictionary to a resource.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        identifier
        Type
        str
        Default
        Description

        The identifier of the resource to deserialize.

      • Name
        schema
        Type
        JsonSchema
        Default
        Description

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

      Response

      Type
      typing_extensions.Self
      Description

      The newly created resource.

    • @classmethod

      subclass_by_name(cls, name : str) -> typing.Optional[type[Resource]]

      Recursively find a resource subclass with the given name.

      Parameters

      • Name
        cls
        Type
        Default
        Description

      • Name
        name
        Type
        str
        Default
        Description

        The name of the class to find.

      Response

      Type
      typing.Optional[type[Resource]]
      Description

      The class with the given name, or `None` if no such class exists.

      Exceptions

      Type
      TypeError
      Description
      If the name is not a valid class name.

    Attributes

    • Name
      name
      Type
      str
      Value

      = 'Trash'

      Description

    • Name
      identifier
      Type
      str
      Value

      = dataclasses.field(default_factory=lambda: str(uuid.uuid4().hex[:8]))

      Description

    • Name
      rotation
      Type
      int
      Value

      = 0

      Description

    • Name
      dimensions
      Type
      Vector
      Value

      = dataclasses.field(default_factory=Vector)

      Description

    • Name
      location
      Type
      typing.Optional[Vector]
      Value

      = None

      Description

    • Name
      Schema
      Type
      type[marshmallow.Schema]
      Value

      = marshmallow.Schema

      Description

    • Name
      absolute_location
      Type
      Vector
      Value

      = None

      Description

      The absolute location of this resource.

    • Name
      width
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the x-axis.

    • Name
      depth
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the y-axis.

    • Name
      height
      Type
      decimal.Decimal
      Value

      = None

      Description

      The size of the resource along the z-axis.

    • Name
      center
      Type
      Vector
      Value

      = None

      Description

      The center base of this resource.

  • UnassignedError

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

    Bases
    RuntimeError
Copyright © 2024