Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
“ramifarawi” committed Jul 15, 2024
1 parent 5371862 commit f0bddd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"content": "import math\nfrom opentrons.protocol_api.labware import Well\n\nfrom opentrons import APIVersion\n\nmetadata = {\n 'protocolName': 'Tube Filling',\n 'author': 'Opentrons <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.13'\n}\n\n\ndef run(protocol):\n [transferVol, tubeRacks, tubeType, numRacks, srcType, srcVol,\n pipType, pipMnt, startTip, dispMode, touchTip] = get_values( # noqa: F821\n 'transferVol', 'tubeRacks', 'tubeType', 'numRacks', 'srcType', 'srcVol',\n 'pipType', 'pipMnt', 'startTip', 'dispMode', 'touchTip')\n\n # Load labware and pipettes\n\n tipNum = pipType.split('_')[0][1:]\n tipNum = '300' if tipNum == '50' else tipNum\n tipType = f'opentrons_96_tiprack_{tipNum}ul'\n tips = [protocol.load_labware(tipType, '11')]\n pip = protocol.load_instrument(pipType, pipMnt, tip_racks=tips)\n\n firstTip = startTip[0].upper()+str(int(startTip[1:]))\n pip.starting_tip = tips[0][firstTip]\n\n srcLabware = protocol.load_labware(srcType, '1')\n\n destRacks = [\n protocol.load_labware(tubeRacks+tubeType, slot) for slot in range(\n 2, 2+numRacks)]\n\n # Functions and Class creation\n if not protocol.is_simulating:\n class WellH(Well):\n def __init__(self, well, height=0, min_height=5, comp_coeff=1.15,\n current_volume=0):\n # Change one is that we deprecated well._impl\n super().__init__(well.parent, well._core, APIVersion(2, 13))\n self.well = well\n self.height = height\n self.min_height = min_height\n self.comp_coeff = comp_coeff\n self.radius = self.diameter / 2\n self.current_volume = current_volume\n\n def height_dec(self, vol):\n dh = (vol / (math.pi * (self.radius ** 2))) * self.comp_coeff\n if self.height - dh > self.min_height:\n self.height = self.height - dh\n else:\n self.height = self.min_height\n if self.current_volume - vol > 0:\n self.current_volume = self.current_volume - vol\n else:\n self.current_volume = 0\n return (self.well.bottom(self.height))\n\n def height_inc(self, vol):\n dh = (vol / (math.pi * (self.radius ** 2))) * self.comp_coeff\n if self.height + dh < self.depth:\n self.height = self.height + dh\n else:\n self.height = self.depth\n self.current_volume += vol\n return (self.well.bottom(self.height + 20))\n\n def yield_groups(list, num):\n \"\"\"\n yield lists based on number of items\n \"\"\"\n for i in range(0, len(list), num):\n yield list[i:i+num]\n\n # get number of distributes pipette can handle\n distribute_num = pip.max_volume // transferVol\n if distribute_num < 1:\n # if transfer volume is greater than pipette max volume,\n # use Transfer mode\n dispMode = 'Transfer'\n\n # create source location with WellH\n source = WellH(\n srcLabware.wells()[0], min_height=3, current_volume=srcVol*1000)\n\n # Protocol: Tube filling\n pip.pick_up_tip()\n all_wells = [well for tuberack in destRacks for well in tuberack.wells()]\n if dispMode == 'Transfer':\n for dest in all_wells:\n pip.transfer(\n transferVol, source.height_dec(transferVol), dest,\n touch_tip=touchTip, new_tip='never')\n else:\n well_groups = list(yield_groups(all_wells, int(distribute_num)))\n for wells in well_groups:\n pip.distribute(\n transferVol, source.height_dec(transferVol), wells,\n blow_out=source, touch_tip=touchTip, new_tip='never')\n pip.drop_tip()\n",
"content": "import math\nfrom opentrons.protocol_api.labware import Well\n\nfrom opentrons import APIVersion\n\nmetadata = {\n 'protocolName': 'Tube Filling',\n 'author': 'Opentrons <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.13'\n}\n\n\ndef run(protocol):\n [transferVol, tubeRacks, tubeType, numRacks, srcType, srcVol,\n pipType, pipMnt, startTip, dispMode, touchTip] = get_values( # noqa: F821\n 'transferVol', 'tubeRacks', 'tubeType', 'numRacks', 'srcType', 'srcVol',\n 'pipType', 'pipMnt', 'startTip', 'dispMode', 'touchTip')\n\n # Load labware and pipettes\n\n tipNum = pipType.split('_')[0][1:]\n tipNum = '300' if tipNum == '50' else tipNum\n tipType = f'opentrons_96_tiprack_{tipNum}ul'\n tips = [protocol.load_labware(tipType, '11')]\n pip = protocol.load_instrument(pipType, pipMnt, tip_racks=tips)\n\n firstTip = startTip[0].upper()+str(int(startTip[1:]))\n pip.starting_tip = tips[0][firstTip]\n\n srcLabware = protocol.load_labware(srcType, '1')\n\n destRacks = [\n protocol.load_labware(tubeRacks+tubeType, slot) for slot in range(\n 2, 2+numRacks)]\n\n # Functions and Class creation\n if not protocol.is_simulating:\n class WellH(Well):\n def __init__(self, well, height=0, min_height=5, comp_coeff=1.15,\n current_volume=0):\n # Change one is that we deprecated well._impl\n super().__init__(well.parent, well._core, APIVersion(2, 13))\n self.well = well\n self.height = height\n self.min_height = min_height\n self.comp_coeff = comp_coeff\n self.radius = self.diameter / 2\n self.current_volume = current_volume\n\n def height_dec(self, vol):\n dh = (vol / (math.pi * (self.radius ** 2))) * self.comp_coeff\n if self.height - dh > self.min_height:\n self.height = self.height - dh\n else:\n self.height = self.min_height\n if self.current_volume - vol > 0:\n self.current_volume = self.current_volume - vol\n else:\n self.current_volume = 0\n return (self.well.bottom(self.height))\n\n def height_inc(self, vol):\n dh = (vol / (math.pi * (self.radius ** 2))) * self.comp_coeff\n if self.height + dh < self.depth:\n self.height = self.height + dh\n else:\n self.height = self.depth\n self.current_volume += vol\n return (self.well.bottom(self.height + 20))\n\n def yield_groups(list, num):\n \"\"\"\n yield lists based on number of items\n \"\"\"\n for i in range(0, len(list), num):\n yield list[i:i+num]\n\n # get number of distributes pipette can handle\n distribute_num = pip.max_volume // transferVol\n if distribute_num < 1:\n # if transfer volume is greater than pipette max volume,\n # use Transfer mode\n dispMode = 'Transfer'\n\n # create source location with WellH\n source = WellH(\n srcLabware.wells()[0], min_height=3, current_volume=srcVol*1000)\n\n # Protocol: Tube filling\n pip.pick_up_tip()\n all_wells = [well for tuberack in destRacks\n for well in tuberack.wells()]\n if dispMode == 'Transfer':\n for dest in all_wells:\n pip.transfer(\n transferVol, source.height_dec(transferVol), dest,\n touch_tip=touchTip, new_tip='never')\n else:\n well_groups = list(yield_groups(all_wells, int(distribute_num)))\n for wells in well_groups:\n pip.distribute(\n transferVol, source.height_dec(transferVol), wells,\n blow_out=source, touch_tip=touchTip, new_tip='never')\n pip.drop_tip()\n",
"custom_labware_defs": [
{
"brand": {
Expand Down
3 changes: 2 additions & 1 deletion protocols/4a0be6/4a0be6.ot2.apiv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def yield_groups(list, num):

# Protocol: Tube filling
pip.pick_up_tip()
all_wells = [well for tuberack in destRacks for well in tuberack.wells()]
all_wells = [well for tuberack in destRacks
for well in tuberack.wells()]
if dispMode == 'Transfer':
for dest in all_wells:
pip.transfer(
Expand Down

0 comments on commit f0bddd5

Please sign in to comment.