Skip to content

Commit

Permalink
fix missed correction_volume instances from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Feb 25, 2025
1 parent 949d794 commit 584cc3a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 22 deletions.
10 changes: 7 additions & 3 deletions api/src/opentrons/protocol_api/core/engine/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def air_gap_in_place(
Args:
volume: The volume of air to aspirate, in microliters.
folw_rate: The flow rate of air into the pipette, in microliters/s
flow_rate: The flow rate of air into the pipette, in microliters/s
"""
self._engine_client.execute_command(
cmd.AirGapInPlaceParams(
Expand All @@ -159,6 +159,7 @@ def aspirate(
flow_rate: float,
in_place: bool,
meniscus_tracking: Optional[MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
"""Aspirate a given volume of liquid from the specified location.
Args:
Expand Down Expand Up @@ -250,6 +251,7 @@ def dispense(
in_place: bool,
push_out: Optional[float],
meniscus_tracking: Optional[MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
"""Dispense a given volume of liquid into the specified location.
Args:
Expand Down Expand Up @@ -833,11 +835,13 @@ def resin_tip_dispense(
if flow_rate is None:
flow_rate = _RESIN_TIP_DEFAULT_FLOW_RATE

well_location = self._engine_client.state.geometry.get_relative_liquid_handling_well_location(
(
well_location,
dynamic_tracking,
) = self._engine_client.state.geometry.get_relative_liquid_handling_well_location(
labware_id=labware_id,
well_name=well_name,
absolute_point=location.point,
is_meniscus=None,
)
pipette_movement_conflict.check_safe_for_pipette_movement(
engine_state=self._engine_client.state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ def aspirate_and_wait(self, volume: float) -> None:
# TODO: handle volume correction
aspirate_props = self._transfer_properties.aspirate
correction_volume = aspirate_props.correction_by_volume.get_for_volume(volume)
is_meniscus = bool(
aspirate_props.position_reference == PositionReference.LIQUID_MENISCUS
)
self._instrument.aspirate(
location=self._target_location,
well_core=None,
Expand All @@ -188,9 +185,6 @@ def dispense_and_wait(
# TODO: handle volume correction
dispense_props = self._transfer_properties.dispense
correction_volume = dispense_props.correction_by_volume.get_for_volume(volume)
is_meniscus = bool(
dispense_props.position_reference == PositionReference.LIQUID_MENISCUS
)
self._instrument.dispense(
location=self._target_location,
well_core=None,
Expand Down
2 changes: 2 additions & 0 deletions api/src/opentrons/protocol_api/core/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def aspirate(
flow_rate: float,
in_place: bool,
meniscus_tracking: Optional[types.MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
"""Aspirate a given volume of liquid from the specified location.
Args:
Expand All @@ -71,6 +72,7 @@ def dispense(
in_place: bool,
push_out: Optional[float],
meniscus_tracking: Optional[types.MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
"""Dispense a given volume of liquid into the specified location.
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def aspirate(
flow_rate: float,
in_place: bool,
meniscus_tracking: Optional[types.MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
"""Aspirate a given volume of liquid from the specified location.
Args:
Expand Down Expand Up @@ -133,6 +134,7 @@ def dispense(
in_place: bool,
push_out: Optional[float],
meniscus_tracking: Optional[types.MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
"""Dispense a given volume of liquid into the specified location.
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def aspirate(
flow_rate: float,
in_place: bool,
meniscus_tracking: Optional[types.MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
if self.get_current_volume() == 0:
# Make sure we're at the top of the labware and clear of any
Expand Down Expand Up @@ -143,6 +144,7 @@ def dispense(
in_place: bool,
push_out: Optional[float],
meniscus_tracking: Optional[types.MeniscusTrackingTarget] = None,
correction_volume: Optional[float] = None,
) -> None:
if isinstance(location, (TrashBin, WasteChute)):
raise APIVersionError(
Expand Down
5 changes: 1 addition & 4 deletions api/src/opentrons/protocol_engine/state/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,7 @@ def get_relative_liquid_handling_well_location(
absolute_point: Point,
meniscus_tracking: Optional[MeniscusTrackingTarget] = None,
) -> Tuple[LiquidHandlingWellLocation, bool]:
"""Given absolute position, get relative location of a well in a labware.
If is_meniscus is True, absolute_point will hold the z-offset in its z field.
"""
"""Given absolute position, get relative location of a well in a labware."""
dynamic_liquid_tracking = False
if meniscus_tracking:
location = LiquidHandlingWellLocation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,17 @@ def test_submerge(


@pytest.mark.parametrize(
argnames=["position_reference", "expected_is_meniscus"],
argnames=["position_reference"],
argvalues=[
[PositionReference.WELL_BOTTOM, False],
[PositionReference.LIQUID_MENISCUS, True],
[PositionReference.WELL_BOTTOM],
[PositionReference.LIQUID_MENISCUS],
],
)
def test_aspirate_and_wait(
decoy: Decoy,
mock_instrument_core: InstrumentCore,
sample_transfer_props: TransferProperties,
position_reference: PositionReference,
expected_is_meniscus: bool,
) -> None:
"""It should execute an aspirate and a delay according to properties."""
source_well = decoy.mock(cls=WellCore)
Expand Down Expand Up @@ -196,18 +195,17 @@ def test_aspirate_and_wait_skips_delay(


@pytest.mark.parametrize(
argnames=["position_reference", "expected_is_meniscus"],
argnames=["position_reference"],
argvalues=[
[PositionReference.WELL_BOTTOM, False],
[PositionReference.LIQUID_MENISCUS, True],
[PositionReference.WELL_BOTTOM],
[PositionReference.LIQUID_MENISCUS],
],
)
def test_dispense_and_wait(
decoy: Decoy,
mock_instrument_core: InstrumentCore,
sample_transfer_props: TransferProperties,
position_reference: PositionReference,
expected_is_meniscus: bool,
) -> None:
"""It should execute a dispense and a delay according to properties."""
source_well = decoy.mock(cls=WellCore)
Expand Down Expand Up @@ -306,7 +304,6 @@ def test_mix(
rate=1,
flow_rate=aspirate_flow_rate,
in_place=True,
is_meniscus=False,
correction_volume=aspirate_correction_volume,
),
mock_instrument_core.delay(0.2),
Expand Down

0 comments on commit 584cc3a

Please sign in to comment.