Skip to content

Commit

Permalink
freeze the ops classes and remove doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwierenga committed Sep 18, 2024
1 parent 515c8a0 commit fd71994
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions pylabrobot/liquid_handling/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,34 @@
from pylabrobot.resources.tip_rack import TipSpot


@dataclass
@dataclass(frozen=True)
class Pickup:
""" A pickup operation. """
resource: TipSpot
offset: Coordinate
tip: Tip # TODO: perhaps we can remove this, because the tip spot has the tip?


@dataclass
@dataclass(frozen=True)
class Drop:
""" A drop operation. """
resource: Resource
offset: Coordinate
tip: Tip


@dataclass
@dataclass(frozen=True)
class PickupTipRack:
""" A pickup operation for an entire tip rack. """

resource: TipRack
offset: Coordinate


@dataclass
@dataclass(frozen=True)
class DropTipRack:
""" A drop operation for an entire tip rack. """

resource: Union[TipRack, Trash]
offset: Coordinate


@dataclass
@dataclass(frozen=True)
class Aspiration:
""" Aspiration contains information about an aspiration. """

resource: Container
offset: Coordinate
tip: Tip
Expand All @@ -60,10 +52,8 @@ class Aspiration:
liquids: List[Tuple[Optional[Liquid], float]]


@dataclass
@dataclass(frozen=True)
class Dispense:
""" Dispense contains information about an dispense. """

resource: Container
offset: Coordinate
tip: Tip
Expand All @@ -74,10 +64,17 @@ class Dispense:
liquids: List[Tuple[Optional[Liquid], float]]


@dataclass
class AspirationPlate:
""" Contains information about an aspiration from a plate (in a single movement). """
class Transfer:
aspiration: Aspiration
dispense: Dispense

def __post_init__(self):
if not self.aspiration.blow_out_air_volume == self.dispense.blow_out_air_volume:
raise ValueError("Aspiration and dispense blow out air volumes must be equal")


@dataclass(frozen=True)
class AspirationPlate:
wells: List[Well]
offset: Coordinate
tips: List[Tip]
Expand All @@ -88,10 +85,8 @@ class AspirationPlate:
liquids: List[List[Tuple[Optional[Liquid], float]]]


@dataclass
@dataclass(frozen=True)
class DispensePlate:
""" Contains information about an aspiration from a plate (in a single movement). """

wells: List[Well]
offset: Coordinate
tips: List[Tip]
Expand All @@ -101,10 +96,8 @@ class DispensePlate:
blow_out_air_volume: Optional[float]
liquids: List[List[Tuple[Optional[Liquid], float]]]

@dataclass
@dataclass(frozen=True)
class AspirationContainer:
""" Contains information about an aspiration from a plate (in a single movement). """

container: Container
offset: Coordinate
tips: List[Tip]
Expand All @@ -115,10 +108,8 @@ class AspirationContainer:
liquids: List[List[Tuple[Optional[Liquid], float]]]


@dataclass
@dataclass(frozen=True)
class DispenseContainer:
""" Contains information about an aspiration from a plate (in a single movement). """

container: Container
offset: Coordinate
tips: List[Tip]
Expand All @@ -130,17 +121,15 @@ class DispenseContainer:


class GripDirection(enum.Enum):
""" A direction from which to grab the resource. """
FRONT = enum.auto()
BACK = enum.auto()
LEFT = enum.auto()
RIGHT = enum.auto()


@dataclass
@dataclass(frozen=True)
class Move:
""" A move operation.
"""
Attributes:
resource: The resource to move.
destination: The destination of the move.
Expand Down

0 comments on commit fd71994

Please sign in to comment.