Skip to content

Commit e0b9daa

Browse files
committed
fix: set operationVolume in the core
1 parent 7df4113 commit e0b9daa

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

api/src/opentrons/protocol_api/core/engine/instrument.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ def aspirate(
153153
absolute_point=location.point,
154154
is_meniscus=is_meniscus,
155155
)
156+
if well_location.origin == WellOrigin.MENISCUS:
157+
well_location.volumeOffset = "operationVolume"
156158
pipette_movement_conflict.check_safe_for_pipette_movement(
157159
engine_state=self._engine_client.state,
158160
pipette_id=self._pipette_id,

api/tests/opentrons/protocol_api/core/engine/test_instrument_core.py

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def test_aspirate_from_well(
545545
)
546546

547547

548-
def test_aspirate_from_location(
548+
def test_aspirate_from_coordinates(
549549
decoy: Decoy,
550550
mock_engine_client: EngineClient,
551551
mock_protocol_core: ProtocolCore,
@@ -583,6 +583,72 @@ def test_aspirate_from_location(
583583
)
584584

585585

586+
def test_aspirate_from_meniscus(
587+
decoy: Decoy,
588+
mock_engine_client: EngineClient,
589+
mock_protocol_core: ProtocolCore,
590+
subject: InstrumentCore,
591+
) -> None:
592+
"""It should aspirate from a well."""
593+
location = Location(point=Point(1, 2, 3), labware=None)
594+
595+
well_core = WellCore(
596+
name="my cool well", labware_id="123abc", engine_client=mock_engine_client
597+
)
598+
599+
decoy.when(
600+
mock_engine_client.state.geometry.get_relative_liquid_handling_well_location(
601+
labware_id="123abc",
602+
well_name="my cool well",
603+
absolute_point=Point(1, 2, 3),
604+
is_meniscus=True,
605+
)
606+
).then_return(
607+
LiquidHandlingWellLocation(
608+
origin=WellOrigin.MENISCUS, offset=WellOffset(x=3, y=2, z=1), volumeOffset=0
609+
)
610+
)
611+
612+
subject.aspirate(
613+
location=location,
614+
well_core=well_core,
615+
volume=12.34,
616+
rate=5.6,
617+
flow_rate=7.8,
618+
in_place=False,
619+
is_meniscus=True,
620+
)
621+
622+
decoy.verify(
623+
pipette_movement_conflict.check_safe_for_pipette_movement(
624+
engine_state=mock_engine_client.state,
625+
pipette_id="abc123",
626+
labware_id="123abc",
627+
well_name="my cool well",
628+
well_location=LiquidHandlingWellLocation(
629+
origin=WellOrigin.MENISCUS,
630+
offset=WellOffset(x=3, y=2, z=1),
631+
volumeOffset="operationVolume",
632+
),
633+
),
634+
mock_engine_client.execute_command(
635+
cmd.AspirateParams(
636+
pipetteId="abc123",
637+
labwareId="123abc",
638+
wellName="my cool well",
639+
wellLocation=LiquidHandlingWellLocation(
640+
origin=WellOrigin.MENISCUS,
641+
offset=WellOffset(x=3, y=2, z=1),
642+
volumeOffset="operationVolume",
643+
),
644+
volume=12.34,
645+
flowRate=7.8,
646+
)
647+
),
648+
mock_protocol_core.set_last_location(location=location, mount=Mount.LEFT),
649+
)
650+
651+
586652
def test_aspirate_in_place(
587653
decoy: Decoy,
588654
mock_engine_client: EngineClient,

0 commit comments

Comments
 (0)