Skip to content

Commit

Permalink
Merge pull request #53 from machineagency/quick_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaPoliti authored Feb 1, 2024
2 parents 30177c5 + 19648c6 commit 7205a76
Show file tree
Hide file tree
Showing 16 changed files with 359 additions and 104 deletions.
159 changes: 122 additions & 37 deletions docs/notebooks/Labware_Object_Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"id": "ca4352ca",
"metadata": {},
"outputs": [],
"source": [
"from labware.Labware import Labware"
"from science_jubilee.labware.Labware import Labware"
]
},
{
Expand All @@ -36,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 6,
"id": "4a7e9ac8",
"metadata": {},
"outputs": [
Expand All @@ -46,7 +46,7 @@
"wellPlate: 20mlscintillation_12_wellplate_18000ul"
]
},
"execution_count": 14,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -97,17 +97,17 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 7,
"id": "7091aef9",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"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)"
"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)"
]
},
"execution_count": 19,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -118,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 8,
"id": "53e3df86",
"metadata": {
"scrolled": true
Expand All @@ -127,10 +127,10 @@
{
"data": {
"text/plain": [
"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)"
"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)"
]
},
"execution_count": 18,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -149,7 +149,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 9,
"id": "0933c8fb",
"metadata": {},
"outputs": [
Expand All @@ -159,7 +159,7 @@
"77.47"
]
},
"execution_count": 20,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -170,7 +170,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 10,
"id": "919cbb2e",
"metadata": {},
"outputs": [
Expand All @@ -180,7 +180,7 @@
"53"
]
},
"execution_count": 21,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -199,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 13,
"id": "15e8a5bf",
"metadata": {},
"outputs": [
Expand All @@ -209,34 +209,43 @@
"60.5"
]
},
"execution_count": 22,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lab[10].top # the actual top of the well"
"lab[10].top_ # the actual top of the well"
]
},
{
"cell_type": "markdown",
"id": "0e23606e",
"metadata": {},
"source": [
"However, you can also indicate a `z` position with resposect to the top or bottom of the well.\n",
"The `x` and `y` coordinates are the same, this command will change the `z` coordinate and return a Location(Point, Well) object"
]
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 14,
"id": "43803268",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"7.5"
"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))"
]
},
"execution_count": 23,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lab[10].bottom"
"lab[10].bottom(+5) "
]
},
{
Expand All @@ -254,17 +263,17 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 15,
"id": "1239f391",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys(['A1', 'A2', 'A3', 'A4', 'B1', 'B2', 'B3', 'B4', 'C1', 'C2', 'C3', 'C4'])"
"dict_keys(['A1', 'B1', 'C1', 'A2', 'B2', 'C2', 'A3', 'B3', 'C3', 'A4', 'B4', 'C4'])"
]
},
"execution_count": 25,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -286,17 +295,17 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 16,
"id": "85d6061d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys(['A1', 'B1', 'C1', 'A2', 'B2', 'C2', 'A3', 'B3', 'C3', 'A4', 'B4', 'C4'])"
"dict_keys(['A1', 'A2', 'A3', 'A4', 'B1', 'B2', 'B3', 'B4', 'C1', 'C2', 'C3', 'C4'])"
]
},
"execution_count": 27,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -316,17 +325,17 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 17,
"id": "b658640c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys(['A1', 'B1', 'C1', 'A2', 'B2', 'C2', 'A3', 'B3', 'C3', 'A4', 'B4', 'C4'])"
"dict_keys(['A1', 'A2', 'A3', 'A4', 'B1', 'B2', 'B3', 'B4', 'C1', 'C2', 'C3', 'C4'])"
]
},
"execution_count": 29,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -349,7 +358,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 18,
"id": "72278f1e",
"metadata": {},
"outputs": [
Expand All @@ -358,9 +367,9 @@
"output_type": "stream",
"text": [
"Well Coordinates for well A1\n",
"x: 23.81\n",
"y: 73.69\n",
"z: 10.95\n"
"x: 21.81\n",
"y: 70.69\n",
"z: 7.5\n"
]
}
],
Expand All @@ -381,7 +390,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 19,
"id": "5bc59fd4",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -414,7 +423,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 20,
"id": "2027a50d",
"metadata": {},
"outputs": [
Expand All @@ -429,6 +438,82 @@
"source": [
"print('Offset : {}'.format(lab[0].offset))"
]
},
{
"cell_type": "markdown",
"id": "e53a2ea3",
"metadata": {},
"source": [
"### 5. Manual Labware Offset Calibration\n",
"\n",
"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",
"To avoid issues with your labware positionining, we've implemented another offset calibration method. \n",
"\n",
"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",
"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",
"\n",
"Note: you can perform the next steps using the Camera/WebCamera tool if you want, the procedure is the same. \n",
"\n",
"1. Pick up a tool (e.g., an OT2 pipette)\n",
"2. Navigate to your labware **top_left** well\n",
"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",
"4. Record your new `x` and `y` coordinates as a tuple.\n",
"5. Repeat steps 2-4 for the **top_right** and **bottom_right** well\n",
"\n",
"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. "
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "22d80cc6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"New manual offset applied to 20mlscintillation_12_wellplate_18000ul\n"
]
}
],
"source": [
"lab.slot = 0 # this will be taken care of by the deck.load_labware() method\n",
"UL = (29.3,78.1)\n",
"UR = (128.0, 77.9)\n",
"BR = (128.2, 15.3)\n",
"\n",
"lab.manual_offset([UL, UR, BR], save= False)"
]
},
{
"cell_type": "markdown",
"id": "73b9891e",
"metadata": {},
"source": [
"You can check if the offset was applied by checking the attribute `manualOffset`."
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "1e32ddd0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'0': [(29.3, 78.1), (128.0, 77.9), (128.2, 15.3)]}"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lab.manualOffset"
]
}
],
"metadata": {
Expand All @@ -447,7 +532,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.9"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 7205a76

Please sign in to comment.