@@ -80,7 +80,7 @@ def out_get(self):
80
80
81
81
class Locations :
82
82
HA = [21 , 20 , 19 , 18 , 17 , 16 , 15 , 14 , 13 , 12 , 11 , 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ]
83
- HB = [21 , 19 , 17 , 15 , 13 , 11 , 9 , 7 , 5 , 3 , 1 ]
83
+ HB = [21 , 19 , 17 , 15 , 14 , 13 , 12 , 11 , 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ]
84
84
I = [i + 1 for i in range (22 )]
85
85
86
86
A : list [str ] = [f'A{ i } ' for i in HA ]
@@ -89,7 +89,17 @@ class Locations:
89
89
Lid : list [str ] = ['B19' , 'B17' ]
90
90
Incu : list [str ] = [f'L{ i } ' for i in I ] + [f'R{ i } ' for i in I ]
91
91
RT : list [str ] = A [:21 ]
92
- Out : list [str ] = A [:21 ] # 13:][::-1] + [b for b in B if b not in 'B21 B19 B17 B15'.split()][::-1]
92
+ Out : dict [str , list [str ]] = {
93
+ '1 of 1' : A [:21 ],
94
+ '2 of 2' : A [:17 ], # up to 17 plates, last batch goes to A
95
+ '1 of 2' : B [4 :][::- 1 ] + A [17 :][::- 1 ], # first batch goes to B then starts to fill A from below
96
+ }
97
+
98
+ '''
99
+ 8,8: 4.5s
100
+ 10,10: 8.9s
101
+ 14,14: 114s
102
+ '''
93
103
94
104
def initial_world (plates : list [Plate ], p : ProtocolConfig ) -> World :
95
105
if p .steps and p .steps [0 ].name in ['Mito' , 'PFA' ]:
@@ -99,14 +109,18 @@ def initial_world(plates: list[Plate], p: ProtocolConfig) -> World:
99
109
100
110
def define_plates (batch_sizes : list [int ]) -> list [list [Plate ]]:
101
111
102
- if len (batch_sizes ) > 1 :
103
- raise ValueError ('More than one batch is disabled after C hotel displaced' )
104
-
105
112
plates : list [list [Plate ]] = []
106
113
107
114
index = 0
108
115
for batch_index , batch_size in enumerate (batch_sizes ):
109
116
assert batch_size > 0
117
+
118
+ out_key = f'{ batch_index + 1 } of { len (batch_sizes )} '
119
+ Out = Locations .Out .get (out_key )
120
+ # print(out_key, len(Out), Out)
121
+ if not Out :
122
+ raise ValueError (f'This configuration of batches, { out_key } , not defined. Try one of { ", " .join (Locations .Out .keys ())} .' )
123
+
110
124
batch : list [Plate ] = []
111
125
rt = Locations .RT
112
126
for index_in_batch in range (batch_size ):
@@ -117,7 +131,7 @@ def define_plates(batch_sizes: list[int]) -> list[list[Plate]]:
117
131
# lid_loc=Locations.Lid[index_in_batch],
118
132
lid_loc = Locations .Lid [index_in_batch % 2 ],
119
133
# lid_loc=Locations.Lid[0],
120
- out_loc = Locations . Out [index ],
134
+ out_loc = Out [index_in_batch ],
121
135
batch_index = batch_index ,
122
136
)]
123
137
index += 1
0 commit comments