Skip to content

Commit

Permalink
check max tip volume before transfer as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sanni-t committed Jan 30, 2025
1 parent b1684cb commit 4437827
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
7 changes: 6 additions & 1 deletion api/src/opentrons/protocol_api/core/engine/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,12 @@ def transfer_liquid( # noqa: C901
source_dest_per_volume_step = tx_commons.expand_for_volume_constraints(
volumes=[volume for _ in range(len(source))],
targets=zip(source, dest),
max_volume=self.get_max_volume(),
max_volume=min(
self.get_max_volume(),
tip_racks[0][1]
.get_well_core("A1")
.get_max_volume(), # Assuming all tips in tiprack are of same volume
),
)

def _drop_tip() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def test_water_transfer_with_volume_more_than_tip_max(
tiprack = simulated_protocol_context.load_labware(
"opentrons_flex_96_tiprack_50ul", "D1"
)
pipette_50 = simulated_protocol_context.load_instrument(
"flex_1channel_50", mount="left", tip_racks=[tiprack]
pipette_1k = simulated_protocol_context.load_instrument(
"flex_1channel_1000", mount="left", tip_racks=[tiprack]
)
nest_plate = simulated_protocol_context.load_labware(
"nest_96_wellplate_200ul_flat", "C3"
Expand All @@ -47,7 +47,7 @@ def test_water_transfer_with_volume_more_than_tip_max(
mock_manager = mock.Mock()
mock_manager.attach_mock(patched_pick_up_tip, "pick_up_tip")

pipette_50.transfer_liquid(
pipette_1k.transfer_liquid(
liquid_class=water,
volume=60,
source=nest_plate.rows()[0],
Expand All @@ -58,7 +58,7 @@ def test_water_transfer_with_volume_more_than_tip_max(
assert patched_pick_up_tip.call_count == 24
patched_pick_up_tip.reset_mock()

pipette_50.transfer_liquid(
pipette_1k.transfer_liquid(
liquid_class=water,
volume=100,
source=nest_plate.rows()[0],
Expand All @@ -69,16 +69,16 @@ def test_water_transfer_with_volume_more_than_tip_max(
assert patched_pick_up_tip.call_count == 12
patched_pick_up_tip.reset_mock()

pipette_50.pick_up_tip()
pipette_50.transfer_liquid(
pipette_1k.pick_up_tip()
pipette_1k.transfer_liquid(
liquid_class=water,
volume=50,
source=nest_plate.rows()[0],
dest=arma_plate.rows()[0],
new_tip="never",
trash_location=trash,
)
pipette_50.drop_tip()
pipette_1k.drop_tip()
assert patched_pick_up_tip.call_count == 1


Expand Down

0 comments on commit 4437827

Please sign in to comment.