14
14
from pylabrobot .resources .tip_rack import TipSpot
15
15
16
16
17
- @dataclass
17
+ @dataclass ( frozen = True )
18
18
class Pickup :
19
- """ A pickup operation. """
20
19
resource : TipSpot
21
20
offset : Coordinate
22
21
tip : Tip # TODO: perhaps we can remove this, because the tip spot has the tip?
23
22
24
23
25
- @dataclass
24
+ @dataclass ( frozen = True )
26
25
class Drop :
27
- """ A drop operation. """
28
26
resource : Resource
29
27
offset : Coordinate
30
28
tip : Tip
31
29
32
30
33
- @dataclass
31
+ @dataclass ( frozen = True )
34
32
class PickupTipRack :
35
- """ A pickup operation for an entire tip rack. """
36
-
37
33
resource : TipRack
38
34
offset : Coordinate
39
35
40
36
41
- @dataclass
37
+ @dataclass ( frozen = True )
42
38
class DropTipRack :
43
- """ A drop operation for an entire tip rack. """
44
-
45
39
resource : Union [TipRack , Trash ]
46
40
offset : Coordinate
47
41
48
42
49
- @dataclass
43
+ @dataclass ( frozen = True )
50
44
class Aspiration :
51
- """ Aspiration contains information about an aspiration. """
52
-
53
45
resource : Container
54
46
offset : Coordinate
55
47
tip : Tip
@@ -60,10 +52,8 @@ class Aspiration:
60
52
liquids : List [Tuple [Optional [Liquid ], float ]]
61
53
62
54
63
- @dataclass
55
+ @dataclass ( frozen = True )
64
56
class Dispense :
65
- """ Dispense contains information about an dispense. """
66
-
67
57
resource : Container
68
58
offset : Coordinate
69
59
tip : Tip
@@ -74,10 +64,17 @@ class Dispense:
74
64
liquids : List [Tuple [Optional [Liquid ], float ]]
75
65
76
66
77
- @dataclass
78
- class AspirationPlate :
79
- """ Contains information about an aspiration from a plate (in a single movement). """
67
+ class Transfer :
68
+ aspiration : Aspiration
69
+ dispense : Dispense
70
+
71
+ def __post_init__ (self ):
72
+ if not self .aspiration .blow_out_air_volume == self .dispense .blow_out_air_volume :
73
+ raise ValueError ("Aspiration and dispense blow out air volumes must be equal" )
74
+
80
75
76
+ @dataclass (frozen = True )
77
+ class AspirationPlate :
81
78
wells : List [Well ]
82
79
offset : Coordinate
83
80
tips : List [Tip ]
@@ -88,10 +85,8 @@ class AspirationPlate:
88
85
liquids : List [List [Tuple [Optional [Liquid ], float ]]]
89
86
90
87
91
- @dataclass
88
+ @dataclass ( frozen = True )
92
89
class DispensePlate :
93
- """ Contains information about an aspiration from a plate (in a single movement). """
94
-
95
90
wells : List [Well ]
96
91
offset : Coordinate
97
92
tips : List [Tip ]
@@ -101,10 +96,8 @@ class DispensePlate:
101
96
blow_out_air_volume : Optional [float ]
102
97
liquids : List [List [Tuple [Optional [Liquid ], float ]]]
103
98
104
- @dataclass
99
+ @dataclass ( frozen = True )
105
100
class AspirationContainer :
106
- """ Contains information about an aspiration from a plate (in a single movement). """
107
-
108
101
container : Container
109
102
offset : Coordinate
110
103
tips : List [Tip ]
@@ -115,10 +108,8 @@ class AspirationContainer:
115
108
liquids : List [List [Tuple [Optional [Liquid ], float ]]]
116
109
117
110
118
- @dataclass
111
+ @dataclass ( frozen = True )
119
112
class DispenseContainer :
120
- """ Contains information about an aspiration from a plate (in a single movement). """
121
-
122
113
container : Container
123
114
offset : Coordinate
124
115
tips : List [Tip ]
@@ -130,17 +121,15 @@ class DispenseContainer:
130
121
131
122
132
123
class GripDirection (enum .Enum ):
133
- """ A direction from which to grab the resource. """
134
124
FRONT = enum .auto ()
135
125
BACK = enum .auto ()
136
126
LEFT = enum .auto ()
137
127
RIGHT = enum .auto ()
138
128
139
129
140
- @dataclass
130
+ @dataclass ( frozen = True )
141
131
class Move :
142
- """ A move operation.
143
-
132
+ """
144
133
Attributes:
145
134
resource: The resource to move.
146
135
destination: The destination of the move.
0 commit comments