diff --git a/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json b/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json index 919e90a2a..a9fffbabc 100644 --- a/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json +++ b/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json @@ -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 ',\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 ',\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": { diff --git a/protocols/4a0be6/4a0be6.ot2.apiv2.py b/protocols/4a0be6/4a0be6.ot2.apiv2.py index 469375747..79245adf4 100644 --- a/protocols/4a0be6/4a0be6.ot2.apiv2.py +++ b/protocols/4a0be6/4a0be6.ot2.apiv2.py @@ -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(