Skip to content

Commit

Permalink
fix: set operationVolume in the core
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster1 committed Oct 28, 2024
1 parent 7df4113 commit e0b9daa
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/src/opentrons/protocol_api/core/engine/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def aspirate(
absolute_point=location.point,
is_meniscus=is_meniscus,
)
if well_location.origin == WellOrigin.MENISCUS:
well_location.volumeOffset = "operationVolume"
pipette_movement_conflict.check_safe_for_pipette_movement(
engine_state=self._engine_client.state,
pipette_id=self._pipette_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def test_aspirate_from_well(
)


def test_aspirate_from_location(
def test_aspirate_from_coordinates(
decoy: Decoy,
mock_engine_client: EngineClient,
mock_protocol_core: ProtocolCore,
Expand Down Expand Up @@ -583,6 +583,72 @@ def test_aspirate_from_location(
)


def test_aspirate_from_meniscus(
decoy: Decoy,
mock_engine_client: EngineClient,
mock_protocol_core: ProtocolCore,
subject: InstrumentCore,
) -> None:
"""It should aspirate from a well."""
location = Location(point=Point(1, 2, 3), labware=None)

well_core = WellCore(
name="my cool well", labware_id="123abc", engine_client=mock_engine_client
)

decoy.when(
mock_engine_client.state.geometry.get_relative_liquid_handling_well_location(
labware_id="123abc",
well_name="my cool well",
absolute_point=Point(1, 2, 3),
is_meniscus=True,
)
).then_return(
LiquidHandlingWellLocation(
origin=WellOrigin.MENISCUS, offset=WellOffset(x=3, y=2, z=1), volumeOffset=0
)
)

subject.aspirate(
location=location,
well_core=well_core,
volume=12.34,
rate=5.6,
flow_rate=7.8,
in_place=False,
is_meniscus=True,
)

decoy.verify(
pipette_movement_conflict.check_safe_for_pipette_movement(
engine_state=mock_engine_client.state,
pipette_id="abc123",
labware_id="123abc",
well_name="my cool well",
well_location=LiquidHandlingWellLocation(
origin=WellOrigin.MENISCUS,
offset=WellOffset(x=3, y=2, z=1),
volumeOffset="operationVolume",
),
),
mock_engine_client.execute_command(
cmd.AspirateParams(
pipetteId="abc123",
labwareId="123abc",
wellName="my cool well",
wellLocation=LiquidHandlingWellLocation(
origin=WellOrigin.MENISCUS,
offset=WellOffset(x=3, y=2, z=1),
volumeOffset="operationVolume",
),
volume=12.34,
flowRate=7.8,
)
),
mock_protocol_core.set_last_location(location=location, mount=Mount.LEFT),
)


def test_aspirate_in_place(
decoy: Decoy,
mock_engine_client: EngineClient,
Expand Down

0 comments on commit e0b9daa

Please sign in to comment.