I have updated the opentrons package.
Unfortunately the problem persists.
I can see the trash_container in the summary now. but i cannot run the command await lh.drop_tips(tip_spots=[trash]*1) without getting an error.
Here is my code:
from pylabrobot.liquid_handling import LiquidHandler
from pylabrobot.liquid_handling.backends import OpentronsBackend
from pylabrobot.resources.opentrons.deck import OTDeck
lh = LiquidHandler(backend=OpentronsBackend(host=“10.199.253.164”), deck=OTDeck(no_trash=True)) # This seems to work
await lh.setup()
from pylabrobot.resources.opentrons import (
opentrons_96_filtertiprack_20ul
)
from pylabrobot.resources.corning_costar import (
Cos_96_EZWash,
Cos_96_DW_1mL
)
tips1 = opentrons_96_filtertiprack_20ul(name=“tip_rack1”)
tips2 = opentrons_96_filtertiprack_20ul(name=“tip_rack2”)
plate1 = Cos_96_EZWash(name=“plate_01”)
plate2 = Cos_96_DW_1mL(name=“plate_02”)
lh.deck.assign_child_at_slot(tips1, slot=3)
lh.deck.assign_child_at_slot(tips2, slot=5)
lh.deck.assign_child_at_slot(plate1, slot=11)
lh.deck.assign_child_at_slot(plate2, slot=10)
print(lh.deck.summary())
Deck: 624.3mm x 565.2mm
±----------------±----------------±----------------+
| | | |
| 10: plate_02 | 11: plate_01 | 12: Empty |
| | | |
±----------------±----------------±----------------+
| | | |
| 7: Empty | 8: Empty | 9: Empty |
| | | |
±----------------±----------------±----------------+
| | | |
| 4: Empty | 5: tip_rack2 | 6: Empty |
| | | |
±----------------±----------------±----------------+
| | | |
| 1: Empty | 2: Empty | 3: tip_rack1 |
| | | |
±----------------±----------------±----------------+
tiprack = lh.get_resource(“tip_rack1”)
await lh.pick_up_tips(tiprack[“A1”])
from pylabrobot.resources.trash import Trash
lh.deck._assign_trash
trash = lh.deck.get_trash_area()
print(lh.deck.summary())
Deck: 624.3mm x 565.2mm
±----------------±----------------±----------------+
| | | |
| 10: plate_02 | 11: plate_01 | 12: trash_co… |
| | | |
±----------------±----------------±----------------+
| | | |
| 7: Empty | 8: Empty | 9: Empty |
| | | |
±----------------±----------------±----------------+
| | | |
| 4: Empty | 5: tip_rack2 | 6: Empty |
| | | |
±----------------±----------------±----------------+
| | | |
| 1: Empty | 2: Empty | 3: tip_rack1 |
| | | |
±----------------±----------------±----------------+
await lh.drop_tips(tip_spots=[trash]*1)
KeyError Traceback (most recent call last)
Cell In[22], line 1
----> 1 await lh.drop_tips(tip_spots=[trash]*1)
3 # await lh.drop_tips(
File c:\users\vikmol\onedrive\dokumenter\github\pylabrobot_dalsa\pylabrobot\machine.py:20, in need_setup_finished..wrapper(self, *args, **kwargs)
18 if not self.setup_finished:
19 raise RuntimeError(“The setup has not finished. See setup
.”)
—> 20 return await func(self, *args, **kwargs)
File c:\users\vikmol\onedrive\dokumenter\github\pylabrobot_dalsa\pylabrobot\liquid_handling\liquid_handler.py:497, in LiquidHandler.drop_tips(self, tip_spots, use_channels, offsets, allow_nonzero_volume, **backend_kwargs)
495 op.resource.tracker.rollback()
496 self.head[channel].rollback()
→ 497 self._trigger_callback(
498 “drop_tips”,
499 liquid_handler=self,
500 operations=drops,
501 use_channels=use_channels,
502 error=error,
503 **backend_kwargs,
504 )
505 else:
506 for channel, op in zip(use_channels, drops):
File c:\users\vikmol\onedrive\dokumenter\github\pylabrobot_dalsa\pylabrobot\liquid_handling\liquid_handler.py:1523, in LiquidHandler._trigger_callback(self, method_name, error, *args, **kwargs)
1521 callback(self, *args, error=error, **kwargs)
1522 elif error is not None:
→ 1523 raise error
File c:\users\vikmol\onedrive\dokumenter\github\pylabrobot_dalsa\pylabrobot\liquid_handling\liquid_handler.py:490, in LiquidHandler.drop_tips(self, tip_spots, use_channels, offsets, allow_nonzero_volume, **backend_kwargs)
487 del backend_kwargs[extra]
489 try:
→ 490 await self.backend.drop_tips(ops=drops, use_channels=use_channels, **backend_kwargs)
491 except Exception as error: # pylint: disable=broad-except
492 for channel, op in zip(use_channels, drops):
File c:\users\vikmol\onedrive\dokumenter\github\pylabrobot_dalsa\pylabrobot\liquid_handling\backends\opentrons_backend.py:306, in OpentronsBackend.drop_tips(self, ops, use_channels)
303 # this feels wrong, why should backends check?
304 assert op.resource.parent is not None, “must not be a floating resource”
→ 306 labware_id = self.defined_labware[op.resource.parent.name] # get name of tip rack
307 tip_max_volume = 20 # op.resource.maximal_volume
308 pipette_id = self.select_tip_pipette(tip_max_volume, with_tip=True)
KeyError: ‘trash_container’
await lh.drop_tips(tip_spots=[trash]*1)