@@ -40,13 +40,37 @@ def build_arg_parser() -> argparse.ArgumentParser:
40
40
default = 1 ,
41
41
)
42
42
arg_parser .add_argument (
43
- "-n " ,
44
- "--labware_amount " ,
43
+ "-x " ,
44
+ "--labware_amount_x " ,
45
45
type = int ,
46
46
required = False ,
47
- help = "Sets the labware amount" ,
47
+ help = "Sets the labware amount for the X a-lxis " ,
48
48
default = 0 ,
49
49
)
50
+ arg_parser .add_argument (
51
+ "-z" ,
52
+ "--labware_amount_z" ,
53
+ type = int ,
54
+ required = False ,
55
+ help = "Sets the labware amount for the Z axis" ,
56
+ default = 0 ,
57
+ )
58
+ arg_parser .add_argument (
59
+ "-l" ,
60
+ "--labware_name" ,
61
+ type = str ,
62
+ required = False ,
63
+ help = "Sets the name of labware" ,
64
+ default = "baseline" ,
65
+ )
66
+ arg_parser .add_argument (
67
+ "-t" ,
68
+ "--test_name" ,
69
+ type = str ,
70
+ required = False ,
71
+ help = "Sets the name of the test" ,
72
+ default = "tof_data_collection" ,
73
+ )
50
74
arg_parser .add_argument (
51
75
"-s" ,
52
76
"--simulate" ,
@@ -61,13 +85,23 @@ class Stacker_TOF_Data_Collection:
61
85
"""Class to collect TOF Sensor data."""
62
86
63
87
def __init__ (
64
- self , simulate : bool , samples : int , interval : int , labware_amount : int
88
+ self ,
89
+ simulate : bool ,
90
+ samples : int ,
91
+ interval : int ,
92
+ labware_amount_x : int ,
93
+ labware_amount_z : int ,
94
+ labware_name : str ,
95
+ test_name : str ,
65
96
) -> None :
66
97
"""Init."""
67
98
self .simulate = simulate
68
99
self .samples = samples
69
100
self .interval = interval
70
- self .labware_amount = labware_amount
101
+ self .labware_amount_x = labware_amount_x
102
+ self .labware_amount_z = labware_amount_z
103
+ self .labware_name = labware_name
104
+ self .test_name = test_name
71
105
self .api : Optional [OT3API ] = None
72
106
self .mount : Optional [OT3Mount ] = None
73
107
self .home : Optional [Point ] = None
@@ -134,25 +168,14 @@ async def stacker_setup(self) -> None:
134
168
135
169
def file_setup (self ) -> None :
136
170
"""Setup where the test output is stored."""
137
- class_name = self .__class__ .__name__
138
- self .test_name = class_name .lower ()
139
171
self .test_header = self .dict_keys_to_line (self .test_data )
140
172
self .test_id = data .create_run_id ()
141
173
self .test_date = "run-" + datetime .utcnow ().strftime ("%y-%m-%d" )
142
- self .test_path = data .create_folder_for_test_data (self .test_name )
143
- if self .labware_amount == 0 :
144
- self .labware_name = "baseline"
145
- self .labware_amount_z = self .labware_amount
146
- elif self .labware_amount == 1 :
147
- self .labware_name = "nest-96-pcr"
148
- self .labware_amount_z = self .labware_amount
149
- elif self .labware_amount == 3 :
150
- self .labware_name = "tiprack"
151
- self .labware_amount = 1
152
- self .labware_amount_z = 3
174
+ class_name = self .__class__ .__name__
175
+ self .test_path = data .create_folder_for_test_data (class_name .lower ())
153
176
for stacker in self .stackers :
154
177
self .test_tag = (
155
- f"labx{ self .labware_amount } _labz{ self .labware_amount_z } _{ stacker } "
178
+ f"labx{ self .labware_amount_x } _labz{ self .labware_amount_z } _{ stacker } "
156
179
)
157
180
test_file = data .create_file_name (
158
181
self .labware_name , self .test_id , self .test_tag
@@ -203,7 +226,7 @@ async def read_stacker_tof(self) -> None:
203
226
test_data ["Stacker_SN" ] = self .stackers [i ]
204
227
test_data ["Axis" ] = str (axis .lower ())
205
228
test_data ["Platform_Position" ] = pos .lower ()
206
- test_data ["Labware_Num_X" ] = str (self .labware_amount )
229
+ test_data ["Labware_Num_X" ] = str (self .labware_amount_x )
207
230
test_data ["Labware_Num_Z" ] = str (self .labware_amount_z )
208
231
test_data ["Sample" ] = str (sample )
209
232
test_data ["Zone" ] = str (zone )
@@ -214,12 +237,13 @@ async def read_stacker_tof(self) -> None:
214
237
# Update the csv with new values
215
238
test_data_str = self .dict_values_to_line (test_data )
216
239
for test_file in self .test_files :
217
- data .append_data_to_file (
218
- test_name = self .test_name ,
219
- run_id = self .test_date ,
220
- file_name = test_file ,
221
- data = test_data_str ,
222
- )
240
+ if self .stackers [i ] in test_file :
241
+ data .append_data_to_file (
242
+ test_name = self .test_name ,
243
+ run_id = self .test_date ,
244
+ file_name = test_file ,
245
+ data = test_data_str ,
246
+ )
223
247
time .sleep (self .interval )
224
248
print ("" )
225
249
@@ -255,6 +279,12 @@ async def run(self) -> None:
255
279
arg_parser = build_arg_parser ()
256
280
args = arg_parser .parse_args ()
257
281
test = Stacker_TOF_Data_Collection (
258
- args .simulate , args .samples , args .interval , args .labware_amount
282
+ args .simulate ,
283
+ args .samples ,
284
+ args .interval ,
285
+ args .labware_amount_x ,
286
+ args .labware_amount_z ,
287
+ args .labware_name ,
288
+ args .test_name ,
259
289
)
260
290
asyncio .run (test .run ())
0 commit comments