Skip to content

Commit 7205a76

Browse files
authored
Merge pull request #53 from machineagency/quick_changes
2 parents 30177c5 + 19648c6 commit 7205a76

16 files changed

+359
-104
lines changed

docs/notebooks/Labware_Object_Demo.ipynb

+122-37
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 1,
15+
"execution_count": 5,
1616
"id": "ca4352ca",
1717
"metadata": {},
1818
"outputs": [],
1919
"source": [
20-
"from labware.Labware import Labware"
20+
"from science_jubilee.labware.Labware import Labware"
2121
]
2222
},
2323
{
@@ -36,7 +36,7 @@
3636
},
3737
{
3838
"cell_type": "code",
39-
"execution_count": 14,
39+
"execution_count": 6,
4040
"id": "4a7e9ac8",
4141
"metadata": {},
4242
"outputs": [
@@ -46,7 +46,7 @@
4646
"wellPlate: 20mlscintillation_12_wellplate_18000ul"
4747
]
4848
},
49-
"execution_count": 14,
49+
"execution_count": 6,
5050
"metadata": {},
5151
"output_type": "execute_result"
5252
}
@@ -97,17 +97,17 @@
9797
},
9898
{
9999
"cell_type": "code",
100-
"execution_count": 19,
100+
"execution_count": 7,
101101
"id": "7091aef9",
102102
"metadata": {},
103103
"outputs": [
104104
{
105105
"data": {
106106
"text/plain": [
107-
"Well(name='C3', depth=53, totalLiquidVolume=18000, shape='circular', diameter=27.85, xDimension=None, yDimension=None, x=77.47, y=15.03, z=7.5, offset=None)"
107+
"Well(name='C3', depth=53, totalLiquidVolume=18000, shape='circular', diameter=27.85, xDimension=None, yDimension=None, x=77.47, y=15.03, z=7.5, offset=None, slot=None)"
108108
]
109109
},
110-
"execution_count": 19,
110+
"execution_count": 7,
111111
"metadata": {},
112112
"output_type": "execute_result"
113113
}
@@ -118,7 +118,7 @@
118118
},
119119
{
120120
"cell_type": "code",
121-
"execution_count": 18,
121+
"execution_count": 8,
122122
"id": "53e3df86",
123123
"metadata": {
124124
"scrolled": true
@@ -127,10 +127,10 @@
127127
{
128128
"data": {
129129
"text/plain": [
130-
"Well(name='C3', depth=53, totalLiquidVolume=18000, shape='circular', diameter=27.85, xDimension=None, yDimension=None, x=77.47, y=15.03, z=7.5, offset=None)"
130+
"Well(name='B4', depth=53, totalLiquidVolume=18000, shape='circular', diameter=27.85, xDimension=None, yDimension=None, x=105.3, y=42.86, z=7.5, offset=None, slot=None)"
131131
]
132132
},
133-
"execution_count": 18,
133+
"execution_count": 8,
134134
"metadata": {},
135135
"output_type": "execute_result"
136136
}
@@ -149,7 +149,7 @@
149149
},
150150
{
151151
"cell_type": "code",
152-
"execution_count": 20,
152+
"execution_count": 9,
153153
"id": "0933c8fb",
154154
"metadata": {},
155155
"outputs": [
@@ -159,7 +159,7 @@
159159
"77.47"
160160
]
161161
},
162-
"execution_count": 20,
162+
"execution_count": 9,
163163
"metadata": {},
164164
"output_type": "execute_result"
165165
}
@@ -170,7 +170,7 @@
170170
},
171171
{
172172
"cell_type": "code",
173-
"execution_count": 21,
173+
"execution_count": 10,
174174
"id": "919cbb2e",
175175
"metadata": {},
176176
"outputs": [
@@ -180,7 +180,7 @@
180180
"53"
181181
]
182182
},
183-
"execution_count": 21,
183+
"execution_count": 10,
184184
"metadata": {},
185185
"output_type": "execute_result"
186186
}
@@ -199,7 +199,7 @@
199199
},
200200
{
201201
"cell_type": "code",
202-
"execution_count": 22,
202+
"execution_count": 13,
203203
"id": "15e8a5bf",
204204
"metadata": {},
205205
"outputs": [
@@ -209,34 +209,43 @@
209209
"60.5"
210210
]
211211
},
212-
"execution_count": 22,
212+
"execution_count": 13,
213213
"metadata": {},
214214
"output_type": "execute_result"
215215
}
216216
],
217217
"source": [
218-
"lab[10].top # the actual top of the well"
218+
"lab[10].top_ # the actual top of the well"
219+
]
220+
},
221+
{
222+
"cell_type": "markdown",
223+
"id": "0e23606e",
224+
"metadata": {},
225+
"source": [
226+
"However, you can also indicate a `z` position with resposect to the top or bottom of the well.\n",
227+
"The `x` and `y` coordinates are the same, this command will change the `z` coordinate and return a Location(Point, Well) object"
219228
]
220229
},
221230
{
222231
"cell_type": "code",
223-
"execution_count": 23,
232+
"execution_count": 14,
224233
"id": "43803268",
225234
"metadata": {},
226235
"outputs": [
227236
{
228237
"data": {
229238
"text/plain": [
230-
"7.5"
239+
"Location(point=(105.3, 42.86, 12.5), labware=Well(name='B4', depth=53, totalLiquidVolume=18000, shape='circular', diameter=27.85, xDimension=None, yDimension=None, x=105.3, y=42.86, z=7.5, offset=None, slot=None))"
231240
]
232241
},
233-
"execution_count": 23,
242+
"execution_count": 14,
234243
"metadata": {},
235244
"output_type": "execute_result"
236245
}
237246
],
238247
"source": [
239-
"lab[10].bottom"
248+
"lab[10].bottom(+5) "
240249
]
241250
},
242251
{
@@ -254,17 +263,17 @@
254263
},
255264
{
256265
"cell_type": "code",
257-
"execution_count": 25,
266+
"execution_count": 15,
258267
"id": "1239f391",
259268
"metadata": {},
260269
"outputs": [
261270
{
262271
"data": {
263272
"text/plain": [
264-
"dict_keys(['A1', 'A2', 'A3', 'A4', 'B1', 'B2', 'B3', 'B4', 'C1', 'C2', 'C3', 'C4'])"
273+
"dict_keys(['A1', 'B1', 'C1', 'A2', 'B2', 'C2', 'A3', 'B3', 'C3', 'A4', 'B4', 'C4'])"
265274
]
266275
},
267-
"execution_count": 25,
276+
"execution_count": 15,
268277
"metadata": {},
269278
"output_type": "execute_result"
270279
}
@@ -286,17 +295,17 @@
286295
},
287296
{
288297
"cell_type": "code",
289-
"execution_count": 27,
298+
"execution_count": 16,
290299
"id": "85d6061d",
291300
"metadata": {},
292301
"outputs": [
293302
{
294303
"data": {
295304
"text/plain": [
296-
"dict_keys(['A1', 'B1', 'C1', 'A2', 'B2', 'C2', 'A3', 'B3', 'C3', 'A4', 'B4', 'C4'])"
305+
"dict_keys(['A1', 'A2', 'A3', 'A4', 'B1', 'B2', 'B3', 'B4', 'C1', 'C2', 'C3', 'C4'])"
297306
]
298307
},
299-
"execution_count": 27,
308+
"execution_count": 16,
300309
"metadata": {},
301310
"output_type": "execute_result"
302311
}
@@ -316,17 +325,17 @@
316325
},
317326
{
318327
"cell_type": "code",
319-
"execution_count": 29,
328+
"execution_count": 17,
320329
"id": "b658640c",
321330
"metadata": {},
322331
"outputs": [
323332
{
324333
"data": {
325334
"text/plain": [
326-
"dict_keys(['A1', 'B1', 'C1', 'A2', 'B2', 'C2', 'A3', 'B3', 'C3', 'A4', 'B4', 'C4'])"
335+
"dict_keys(['A1', 'A2', 'A3', 'A4', 'B1', 'B2', 'B3', 'B4', 'C1', 'C2', 'C3', 'C4'])"
327336
]
328337
},
329-
"execution_count": 29,
338+
"execution_count": 17,
330339
"metadata": {},
331340
"output_type": "execute_result"
332341
}
@@ -349,7 +358,7 @@
349358
},
350359
{
351360
"cell_type": "code",
352-
"execution_count": 10,
361+
"execution_count": 18,
353362
"id": "72278f1e",
354363
"metadata": {},
355364
"outputs": [
@@ -358,9 +367,9 @@
358367
"output_type": "stream",
359368
"text": [
360369
"Well Coordinates for well A1\n",
361-
"x: 23.81\n",
362-
"y: 73.69\n",
363-
"z: 10.95\n"
370+
"x: 21.81\n",
371+
"y: 70.69\n",
372+
"z: 7.5\n"
364373
]
365374
}
366375
],
@@ -381,7 +390,7 @@
381390
},
382391
{
383392
"cell_type": "code",
384-
"execution_count": 11,
393+
"execution_count": 19,
385394
"id": "5bc59fd4",
386395
"metadata": {},
387396
"outputs": [
@@ -414,7 +423,7 @@
414423
},
415424
{
416425
"cell_type": "code",
417-
"execution_count": 12,
426+
"execution_count": 20,
418427
"id": "2027a50d",
419428
"metadata": {},
420429
"outputs": [
@@ -429,6 +438,82 @@
429438
"source": [
430439
"print('Offset : {}'.format(lab[0].offset))"
431440
]
441+
},
442+
{
443+
"cell_type": "markdown",
444+
"id": "e53a2ea3",
445+
"metadata": {},
446+
"source": [
447+
"### 5. Manual Labware Offset Calibration\n",
448+
"\n",
449+
"There may be instances in which the squaring between the deck and the carriage arm of your Jubilee might not be 100% the same. \n",
450+
"To avoid issues with your labware positionining, we've implemented another offset calibration method. \n",
451+
"\n",
452+
"After placing your labware onto the deck slot, you can follow follow the next few steps to record and apply a namual offset for your labware in *that* slot.\n",
453+
"For this you will record the **true** `x` and `y` coordinates 3 corner wells of your labware. Generally these will be you top left, top right, and bottom right wells. For examples for a 96-well wellplate, these will be : `A1`, `A12`, and `H12`, respectively. \n",
454+
"\n",
455+
"Note: you can perform the next steps using the Camera/WebCamera tool if you want, the procedure is the same. \n",
456+
"\n",
457+
"1. Pick up a tool (e.g., an OT2 pipette)\n",
458+
"2. Navigate to your labware **top_left** well\n",
459+
"3. Use the Duet GUI to move the pipette to the \"actual\" center of your well if the tool is nto perfectly centered over the well. \n",
460+
"4. Record your new `x` and `y` coordinates as a tuple.\n",
461+
"5. Repeat steps 2-4 for the **top_right** and **bottom_right** well\n",
462+
"\n",
463+
"After this, you can run the `your_labware.manual_offset()` method. This allows also to save these offsets in the labware `.json` file for future use, as well as later on load them back up without having to re-run this procedure. Note: this will need to be repeated if you laod your labware on a different slot *OR* if you take down and re-build your machine. "
464+
]
465+
},
466+
{
467+
"cell_type": "code",
468+
"execution_count": 21,
469+
"id": "22d80cc6",
470+
"metadata": {},
471+
"outputs": [
472+
{
473+
"name": "stdout",
474+
"output_type": "stream",
475+
"text": [
476+
"New manual offset applied to 20mlscintillation_12_wellplate_18000ul\n"
477+
]
478+
}
479+
],
480+
"source": [
481+
"lab.slot = 0 # this will be taken care of by the deck.load_labware() method\n",
482+
"UL = (29.3,78.1)\n",
483+
"UR = (128.0, 77.9)\n",
484+
"BR = (128.2, 15.3)\n",
485+
"\n",
486+
"lab.manual_offset([UL, UR, BR], save= False)"
487+
]
488+
},
489+
{
490+
"cell_type": "markdown",
491+
"id": "73b9891e",
492+
"metadata": {},
493+
"source": [
494+
"You can check if the offset was applied by checking the attribute `manualOffset`."
495+
]
496+
},
497+
{
498+
"cell_type": "code",
499+
"execution_count": 24,
500+
"id": "1e32ddd0",
501+
"metadata": {},
502+
"outputs": [
503+
{
504+
"data": {
505+
"text/plain": [
506+
"{'0': [(29.3, 78.1), (128.0, 77.9), (128.2, 15.3)]}"
507+
]
508+
},
509+
"execution_count": 24,
510+
"metadata": {},
511+
"output_type": "execute_result"
512+
}
513+
],
514+
"source": [
515+
"lab.manualOffset"
516+
]
432517
}
433518
],
434519
"metadata": {
@@ -447,7 +532,7 @@
447532
"name": "python",
448533
"nbconvert_exporter": "python",
449534
"pygments_lexer": "ipython3",
450-
"version": "3.8.9"
535+
"version": "3.9.12"
451536
}
452537
},
453538
"nbformat": 4,

0 commit comments

Comments
 (0)