From 8acb8e664f4341804f10c3b34bb343191dc31fc2 Mon Sep 17 00:00:00 2001 From: caila-marashaj Date: Thu, 16 Jan 2025 16:15:50 -0500 Subject: [PATCH] lint fix --- .../protocol_api/core/engine/instrument.py | 24 +-- .../engine/transfer_components_executor.py | 3 - .../legacy_instrument_core.py | 2 + .../protocol_api/instrument_context.py | 162 +++++++++--------- .../protocol_engine/commands/aspirate.py | 5 +- .../commands/pipetting_common.py | 98 +++++++++++ .../protocol_engine/execution/pipetting.py | 55 +++--- .../protocol_engine/state/geometry.py | 12 +- .../core/engine/test_instrument_core.py | 23 ++- .../test_transfer_components_executor.py | 9 - api/tests/opentrons/protocol_api/test_well.py | 2 +- .../state/test_geometry_view.py | 5 +- 12 files changed, 257 insertions(+), 143 deletions(-) diff --git a/api/src/opentrons/protocol_api/core/engine/instrument.py b/api/src/opentrons/protocol_api/core/engine/instrument.py index 5f35309395a..06bbc6413c8 100644 --- a/api/src/opentrons/protocol_api/core/engine/instrument.py +++ b/api/src/opentrons/protocol_api/core/engine/instrument.py @@ -181,19 +181,15 @@ def aspirate( well_name = well_core.get_name() labware_id = well_core.labware_id - well_location = self._engine_client.state.geometry.get_relative_liquid_handling_well_location( + ( + well_location, + dynamic_liquid_tracking, + ) = self._engine_client.state.geometry.get_relative_liquid_handling_well_location( labware_id=labware_id, well_name=well_name, absolute_point=location.point, meniscus_tracking=meniscus_tracking, ) - dynamic_liquid_tracking = False - # caila bookmark - if meniscus_tracking: - if meniscus_tracking.target == "end": - well_location.volumeOffset = "operationVolume" - elif meniscus_tracking.target == "dynamic_meniscus": - dynamic_liquid_tracking = True pipette_movement_conflict.check_safe_for_pipette_movement( engine_state=self._engine_client.state, pipette_id=self._pipette_id, @@ -293,18 +289,16 @@ def dispense( well_name = well_core.get_name() labware_id = well_core.labware_id - well_location = self._engine_client.state.geometry.get_relative_liquid_handling_well_location( + ( + well_location, + dynamic_liquid_tracking, + ) = self._engine_client.state.geometry.get_relative_liquid_handling_well_location( labware_id=labware_id, well_name=well_name, absolute_point=location.point, meniscus_tracking=meniscus_tracking, ) - dynamic_liquid_tracking = False - if meniscus_tracking: - if meniscus_tracking.target == "end": - well_location.volumeOffset = "operationVolume" - elif meniscus_tracking.target == "dynamic_meniscus": - dynamic_liquid_tracking = True + pipette_movement_conflict.check_safe_for_pipette_movement( engine_state=self._engine_client.state, pipette_id=self._pipette_id, diff --git a/api/src/opentrons/protocol_api/core/engine/transfer_components_executor.py b/api/src/opentrons/protocol_api/core/engine/transfer_components_executor.py index 87e41ee98dc..4d48b2ab85a 100644 --- a/api/src/opentrons/protocol_api/core/engine/transfer_components_executor.py +++ b/api/src/opentrons/protocol_api/core/engine/transfer_components_executor.py @@ -168,7 +168,6 @@ def aspirate_and_wait(self, volume: float) -> None: rate=1, flow_rate=aspirate_props.flow_rate_by_volume.get_for_volume(volume), in_place=True, - is_meniscus=None, # TODO: update this once meniscus is implemented ) self._tip_state.append_liquid(volume) delay_props = aspirate_props.delay @@ -191,7 +190,6 @@ def dispense_and_wait( flow_rate=dispense_props.flow_rate_by_volume.get_for_volume(volume), in_place=True, push_out=push_out_override, - is_meniscus=None, ) if push_out_override: # If a push out was performed, we need to reset the plunger before we can aspirate again @@ -536,7 +534,6 @@ def _remove_air_gap(self, location: Location) -> None: rate=1, flow_rate=flow_rate, in_place=True, - is_meniscus=None, push_out=0, ) self._tip_state.delete_air_gap(last_air_gap) diff --git a/api/src/opentrons/protocol_api/core/legacy_simulator/legacy_instrument_core.py b/api/src/opentrons/protocol_api/core/legacy_simulator/legacy_instrument_core.py index 2dc5585fb62..1c69ebeb1ed 100644 --- a/api/src/opentrons/protocol_api/core/legacy_simulator/legacy_instrument_core.py +++ b/api/src/opentrons/protocol_api/core/legacy_simulator/legacy_instrument_core.py @@ -98,6 +98,7 @@ def aspirate( rate: float, flow_rate: float, in_place: bool, + meniscus_tracking: Optional[types.MeniscusTracking] = None, ) -> None: if self.get_current_volume() == 0: # Make sure we're at the top of the labware and clear of any @@ -139,6 +140,7 @@ def dispense( flow_rate: float, in_place: bool, push_out: Optional[float], + meniscus_tracking: Optional[types.MeniscusTracking] = None, ) -> None: if isinstance(location, (TrashBin, WasteChute)): raise APIVersionError( diff --git a/api/src/opentrons/protocol_api/instrument_context.py b/api/src/opentrons/protocol_api/instrument_context.py index fdd611bcbed..2d66a741e3c 100644 --- a/api/src/opentrons/protocol_api/instrument_context.py +++ b/api/src/opentrons/protocol_api/instrument_context.py @@ -1,7 +1,7 @@ from __future__ import annotations import logging from contextlib import ExitStack -from typing import Any, List, Optional, Sequence, Union, cast, Dict, Tuple, Literal +from typing import Any, List, Optional, Sequence, Union, cast, Dict from opentrons_shared_data.errors.exceptions import ( CommandPreconditionViolated, CommandParameterLimitViolated, @@ -550,7 +550,86 @@ def dispense_while_tracking( return self @requires_version(2, 0) - def dispense( # noqa: C901 + def mix( + self, + repetitions: int = 1, + volume: Optional[float] = None, + location: Optional[Union[types.Location, labware.Well]] = None, + rate: float = 1.0, + ) -> InstrumentContext: + """ + Mix a volume of liquid by repeatedly aspirating and dispensing it in a single location. + + See :ref:`mix` for examples. + + :param repetitions: Number of times to mix (default is 1). + :param volume: The volume to mix, measured in µL. If unspecified, defaults + to the maximum volume for the pipette and its attached tip. + + If ``mix`` is called with a volume of precisely 0, its behavior + depends on the API level of the protocol. On API levels below 2.16, + it will behave the same as a volume of ``None``/unspecified: mix + the full working volume of the pipette. On API levels at or above 2.16, + no liquid will be mixed. + :param location: The :py:class:`.Well` or :py:class:`~.types.Location` where the + pipette will mix. If unspecified, the pipette will mix at its + current position. + :param rate: How quickly the pipette aspirates and dispenses liquid while + mixing. The aspiration flow rate is calculated as ``rate`` + multiplied by :py:attr:`flow_rate.aspirate `. The + dispensing flow rate is calculated as ``rate`` multiplied by + :py:attr:`flow_rate.dispense `. See + :ref:`new-plunger-flow-rates`. + :raises: ``UnexpectedTipRemovalError`` -- If no tip is attached to the pipette. + :returns: This instance. + + .. note:: + + All the arguments of ``mix`` are optional. However, if you omit one of them, + all subsequent arguments must be passed as keyword arguments. For instance, + ``pipette.mix(1, location=wellplate['A1'])`` is a valid call, but + ``pipette.mix(1, wellplate['A1'])`` is not. + + .. versionchanged:: 2.21 + Does not repeatedly check for liquid presence. + """ + _log.debug( + "mixing {}uL with {} repetitions in {} at rate={}".format( + volume, repetitions, location if location else "current position", rate + ) + ) + if not self._core.has_tip(): + raise UnexpectedTipRemovalError("mix", self.name, self.mount) + + if self.api_version >= APIVersion(2, 16): + c_vol = self._core.get_available_volume() if volume is None else volume + else: + c_vol = self._core.get_available_volume() if not volume else volume + + dispense_kwargs: Dict[str, Any] = {} + if self.api_version >= APIVersion(2, 16): + dispense_kwargs["push_out"] = 0.0 + + with publisher.publish_context( + broker=self.broker, + command=cmds.mix( + instrument=self, + repetitions=repetitions, + volume=c_vol, + location=location, + ), + ): + self.aspirate(volume, location, rate) + with AutoProbeDisable(self): + while repetitions - 1 > 0: + self.dispense(volume, rate=rate, **dispense_kwargs) + self.aspirate(volume, rate=rate) + repetitions -= 1 + self.dispense(volume, rate=rate) + return self + + @requires_version(2, 0) + def dispense( self, volume: Optional[float] = None, location: Optional[ @@ -727,85 +806,6 @@ def dispense( # noqa: C901 return self - @requires_version(2, 0) - def mix( - self, - repetitions: int = 1, - volume: Optional[float] = None, - location: Optional[Union[types.Location, labware.Well]] = None, - rate: float = 1.0, - ) -> InstrumentContext: - """ - Mix a volume of liquid by repeatedly aspirating and dispensing it in a single location. - - See :ref:`mix` for examples. - - :param repetitions: Number of times to mix (default is 1). - :param volume: The volume to mix, measured in µL. If unspecified, defaults - to the maximum volume for the pipette and its attached tip. - - If ``mix`` is called with a volume of precisely 0, its behavior - depends on the API level of the protocol. On API levels below 2.16, - it will behave the same as a volume of ``None``/unspecified: mix - the full working volume of the pipette. On API levels at or above 2.16, - no liquid will be mixed. - :param location: The :py:class:`.Well` or :py:class:`~.types.Location` where the - pipette will mix. If unspecified, the pipette will mix at its - current position. - :param rate: How quickly the pipette aspirates and dispenses liquid while - mixing. The aspiration flow rate is calculated as ``rate`` - multiplied by :py:attr:`flow_rate.aspirate `. The - dispensing flow rate is calculated as ``rate`` multiplied by - :py:attr:`flow_rate.dispense `. See - :ref:`new-plunger-flow-rates`. - :raises: ``UnexpectedTipRemovalError`` -- If no tip is attached to the pipette. - :returns: This instance. - - .. note:: - - All the arguments of ``mix`` are optional. However, if you omit one of them, - all subsequent arguments must be passed as keyword arguments. For instance, - ``pipette.mix(1, location=wellplate['A1'])`` is a valid call, but - ``pipette.mix(1, wellplate['A1'])`` is not. - - .. versionchanged:: 2.21 - Does not repeatedly check for liquid presence. - """ - _log.debug( - "mixing {}uL with {} repetitions in {} at rate={}".format( - volume, repetitions, location if location else "current position", rate - ) - ) - if not self._core.has_tip(): - raise UnexpectedTipRemovalError("mix", self.name, self.mount) - - if self.api_version >= APIVersion(2, 16): - c_vol = self._core.get_available_volume() if volume is None else volume - else: - c_vol = self._core.get_available_volume() if not volume else volume - - dispense_kwargs: Dict[str, Any] = {} - if self.api_version >= APIVersion(2, 16): - dispense_kwargs["push_out"] = 0.0 - - with publisher.publish_context( - broker=self.broker, - command=cmds.mix( - instrument=self, - repetitions=repetitions, - volume=c_vol, - location=location, - ), - ): - self.aspirate(volume, location, rate) - with AutoProbeDisable(self): - while repetitions - 1 > 0: - self.dispense(volume, rate=rate, **dispense_kwargs) - self.aspirate(volume, rate=rate) - repetitions -= 1 - self.dispense(volume, rate=rate) - return self - @requires_version(2, 0) def blow_out( self, diff --git a/api/src/opentrons/protocol_engine/commands/aspirate.py b/api/src/opentrons/protocol_engine/commands/aspirate.py index 9664d733b8a..b07cd522f93 100644 --- a/api/src/opentrons/protocol_engine/commands/aspirate.py +++ b/api/src/opentrons/protocol_engine/commands/aspirate.py @@ -47,7 +47,10 @@ class AspirateParams( - PipetteIdMixin, AspirateVolumeMixin, FlowRateMixin, LiquidHandlingWellLocationMixin + PipetteIdMixin, + AspirateVolumeMixin, + FlowRateMixin, + LiquidHandlingWellLocationMixin, ): """Parameters required to aspirate from a specific well.""" diff --git a/api/src/opentrons/protocol_engine/commands/pipetting_common.py b/api/src/opentrons/protocol_engine/commands/pipetting_common.py index c373642a02e..6740a4babb3 100644 --- a/api/src/opentrons/protocol_engine/commands/pipetting_common.py +++ b/api/src/opentrons/protocol_engine/commands/pipetting_common.py @@ -217,6 +217,104 @@ async def aspirate_in_place( ) +async def aspirate_while_tracking( + pipette_id: str, + labware_id: str, + well_name: str, + volume: float, + flow_rate: float, + location_if_error: ErrorLocationInfo, + command_note_adder: CommandNoteAdder, + pipetting: PipettingHandler, + model_utils: ModelUtils, +) -> SuccessData[BaseLiquidHandlingResult] | DefinedErrorData[OverpressureError]: + """Execute an aspirate while tracking microoperation.""" + try: + volume_aspirated = await pipetting.aspirate_while_tracking( + pipette_id=pipette_id, + labware_id=labware_id, + well_name=well_name, + volume=volume, + flow_rate=flow_rate, + command_note_adder=command_note_adder, + ) + except PipetteOverpressureError as e: + return DefinedErrorData( + public=OverpressureError( + id=model_utils.generate_id(), + createdAt=model_utils.get_timestamp(), + wrappedErrors=[ + ErrorOccurrence.from_failed( + id=model_utils.generate_id(), + createdAt=model_utils.get_timestamp(), + error=e, + ) + ], + errorInfo=location_if_error, + ), + state_update=StateUpdate().set_fluid_unknown(pipette_id=pipette_id), + ) + else: + return SuccessData( + public=BaseLiquidHandlingResult( + volume=volume_aspirated, + ), + state_update=StateUpdate().set_fluid_aspirated( + pipette_id=pipette_id, + fluid=AspiratedFluid(kind=FluidKind.LIQUID, volume=volume_aspirated), + ), + ) + + +async def dispense_while_tracking( + pipette_id: str, + labware_id: str, + well_name: str, + volume: float, + flow_rate: float, + push_out: float | None, + location_if_error: ErrorLocationInfo, + pipetting: PipettingHandler, + model_utils: ModelUtils, +) -> SuccessData[BaseLiquidHandlingResult] | DefinedErrorData[OverpressureError]: + """Execute an dispense while tracking microoperation.""" + try: + volume_dispensed = await pipetting.dispense_while_tracking( + pipette_id=pipette_id, + labware_id=labware_id, + well_name=well_name, + volume=volume, + flow_rate=flow_rate, + push_out=push_out, + ) + except PipetteOverpressureError as e: + return DefinedErrorData( + public=OverpressureError( + id=model_utils.generate_id(), + createdAt=model_utils.get_timestamp(), + wrappedErrors=[ + ErrorOccurrence.from_failed( + id=model_utils.generate_id(), + createdAt=model_utils.get_timestamp(), + error=e, + ) + ], + errorInfo=location_if_error, + ), + state_update=StateUpdate().set_fluid_unknown(pipette_id=pipette_id), + ) + else: + return SuccessData( + public=BaseLiquidHandlingResult( + volume=volume_dispensed, + ), + state_update=StateUpdate().set_fluid_ejected( + pipette_id=pipette_id, + volume=volume_dispensed, + ), + ) + + async def dispense_in_place( pipette_id: str, volume: float, diff --git a/api/src/opentrons/protocol_engine/execution/pipetting.py b/api/src/opentrons/protocol_engine/execution/pipetting.py index fcba6437b46..2365347348e 100644 --- a/api/src/opentrons/protocol_engine/execution/pipetting.py +++ b/api/src/opentrons/protocol_engine/execution/pipetting.py @@ -1,5 +1,5 @@ """Pipetting command handling.""" -from typing import Optional, Iterator +from typing import Optional, Iterator, Tuple from typing_extensions import Protocol as TypingProtocol from contextlib import contextmanager @@ -45,6 +45,28 @@ async def aspirate_in_place( ) -> float: """Set flow-rate and aspirate.""" + async def aspirate_while_tracking( + self, + pipette_id: str, + labware_id: str, + well_name: str, + volume: float, + flow_rate: float, + command_note_adder: CommandNoteAdder, + ) -> float: + """Set flow-rate and aspirate while tracking.""" + + async def dispense_while_tracking( + self, + pipette_id: str, + labware_id: str, + well_name: str, + volume: float, + flow_rate: float, + push_out: Optional[float], + ) -> float: + """Set flow-rate and dispense while tracking.""" + async def dispense_in_place( self, pipette_id: str, @@ -150,7 +172,7 @@ async def aspirate_while_tracking( PipetteOverpressureError, propagated as-is from the hardware controller. """ # get mount and config data from state and hardware controller - hw_pipette, adjusted_volume = self.get_hw_aspirate_params( + """hw_pipette, adjusted_volume = self.get_hw_aspirate_params( pipette_id, volume, command_note_adder ) @@ -166,8 +188,9 @@ async def aspirate_while_tracking( flow_rate=flow_rate, volume=adjusted_volume, ) - # raise ValueError(f"adjusted volume = {adjusted_volume}\n volume = {volume}") return adjusted_volume + """ + return 0.0 async def dispense_while_tracking( self, @@ -184,7 +207,7 @@ async def dispense_while_tracking( PipetteOverpressureError, propagated as-is from the hardware controller. """ # get mount and config data from state and hardware controller - hw_pipette, adjusted_volume = self.get_hw_dispense_params(pipette_id, volume) + """hw_pipette, adjusted_volume = self.get_hw_dispense_params(pipette_id, volume) dispense_z_distance = self._state_view.geometry.get_liquid_handling_z_change( labware_id=labware_id, @@ -201,6 +224,8 @@ async def dispense_while_tracking( ) return adjusted_volume + """ + return 0.0 async def aspirate_in_place( self, @@ -215,15 +240,8 @@ async def aspirate_in_place( PipetteOverpressureError, propagated as-is from the hardware controller. """ # get mount and config data from state and hardware controller - adjusted_volume = _validate_aspirate_volume( - state_view=self._state_view, - pipette_id=pipette_id, - aspirate_volume=volume, - command_note_adder=command_note_adder, - ) - hw_pipette = self._state_view.pipettes.get_hardware_pipette( - pipette_id=pipette_id, - attached_pipettes=self._hardware_api.attached_instruments, + hw_pipette, adjusted_volume = self.get_hw_aspirate_params( + pipette_id, volume, command_note_adder ) with self._set_flow_rate(pipette=hw_pipette, aspirate_flow_rate=flow_rate): await self._hardware_api.aspirate( @@ -240,13 +258,7 @@ async def dispense_in_place( push_out: Optional[float], ) -> float: """Dispense liquid without moving the pipette.""" - adjusted_volume = _validate_dispense_volume( - state_view=self._state_view, pipette_id=pipette_id, dispense_volume=volume - ) - hw_pipette = self._state_view.pipettes.get_hardware_pipette( - pipette_id=pipette_id, - attached_pipettes=self._hardware_api.attached_instruments, - ) + hw_pipette, adjusted_volume = self.get_hw_dispense_params(pipette_id, volume) # TODO (tz, 8-23-23): add a check for push_out not larger that the max volume allowed when working on this https://opentrons.atlassian.net/browse/RSS-329 if push_out and push_out < 0: raise InvalidPushOutVolumeError( @@ -375,7 +387,6 @@ async def dispense_in_place( raise InvalidPushOutVolumeError( "push out value cannot have a negative value." ) - raise ValueError("why am i here") self._validate_tip_attached(pipette_id=pipette_id, command_name="dispense") return _validate_dispense_volume( state_view=self._state_view, pipette_id=pipette_id, dispense_volume=volume @@ -441,12 +452,10 @@ async def dispense_while_tracking( raise InvalidPushOutVolumeError( "push out value cannot have a negative value." ) - # raise ValueError("here") self._validate_tip_attached(pipette_id=pipette_id, command_name="dispense") return _validate_dispense_volume( state_view=self._state_view, pipette_id=pipette_id, dispense_volume=volume ) - # return volume def create_pipetting_handler( diff --git a/api/src/opentrons/protocol_engine/state/geometry.py b/api/src/opentrons/protocol_engine/state/geometry.py index dabc5636843..e93b9c43e57 100644 --- a/api/src/opentrons/protocol_engine/state/geometry.py +++ b/api/src/opentrons/protocol_engine/state/geometry.py @@ -540,22 +540,28 @@ def get_relative_liquid_handling_well_location( well_name: str, absolute_point: Point, meniscus_tracking: Optional[MeniscusTracking] = None, - ) -> LiquidHandlingWellLocation: + ) -> 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. """ + dynamic_liquid_tracking = False if meniscus_tracking: - return LiquidHandlingWellLocation( + location = LiquidHandlingWellLocation( origin=WellOrigin.MENISCUS, offset=WellOffset(x=0, y=0, z=absolute_point.z), ) + if meniscus_tracking.target == "end": + location.volumeOffset = "operationVolume" + elif meniscus_tracking.target == "dynamic_meniscus": + dynamic_liquid_tracking = True else: well_absolute_point = self.get_well_position(labware_id, well_name) delta = absolute_point - well_absolute_point - return LiquidHandlingWellLocation( + location = LiquidHandlingWellLocation( offset=WellOffset(x=delta.x, y=delta.y, z=delta.z) ) + return location, dynamic_liquid_tracking def get_relative_pick_up_tip_well_location( self, diff --git a/api/tests/opentrons/protocol_api/core/engine/test_instrument_core.py b/api/tests/opentrons/protocol_api/core/engine/test_instrument_core.py index 68f38c05963..04b94295a70 100644 --- a/api/tests/opentrons/protocol_api/core/engine/test_instrument_core.py +++ b/api/tests/opentrons/protocol_api/core/engine/test_instrument_core.py @@ -586,8 +586,11 @@ def test_aspirate_from_well( absolute_point=Point(1, 2, 3), ) ).then_return( - LiquidHandlingWellLocation( - origin=WellOrigin.TOP, offset=WellOffset(x=3, y=2, z=1) + ( + LiquidHandlingWellLocation( + origin=WellOrigin.TOP, offset=WellOffset(x=3, y=2, z=1) + ), + False, ) ) @@ -684,8 +687,13 @@ def test_aspirate_from_meniscus( absolute_point=Point(1, 2, 3), ) ).then_return( - LiquidHandlingWellLocation( - origin=WellOrigin.MENISCUS, offset=WellOffset(x=3, y=2, z=1), volumeOffset=0 + ( + LiquidHandlingWellLocation( + origin=WellOrigin.MENISCUS, + offset=WellOffset(x=3, y=2, z=1), + volumeOffset=0, + ), + False, ) ) @@ -880,8 +888,11 @@ def test_dispense_to_well( absolute_point=Point(1, 2, 3), ) ).then_return( - LiquidHandlingWellLocation( - origin=WellOrigin.TOP, offset=WellOffset(x=3, y=2, z=1) + ( + LiquidHandlingWellLocation( + origin=WellOrigin.TOP, offset=WellOffset(x=3, y=2, z=1) + ), + False, ) ) diff --git a/api/tests/opentrons/protocol_api/core/engine/test_transfer_components_executor.py b/api/tests/opentrons/protocol_api/core/engine/test_transfer_components_executor.py index 6eecfccf882..0f488c8aabb 100644 --- a/api/tests/opentrons/protocol_api/core/engine/test_transfer_components_executor.py +++ b/api/tests/opentrons/protocol_api/core/engine/test_transfer_components_executor.py @@ -107,7 +107,6 @@ def test_submerge( rate=1, flow_rate=air_gap_removal_flow_rate, in_place=True, - is_meniscus=None, push_out=0, ), mock_instrument_core.delay(0.5), @@ -150,7 +149,6 @@ def test_aspirate_and_wait( rate=1, flow_rate=aspirate_flow_rate, in_place=True, - is_meniscus=None, ), mock_instrument_core.delay(0.2), ) @@ -209,7 +207,6 @@ def test_dispense_and_wait( flow_rate=dispense_flow_rate, in_place=True, push_out=123, - is_meniscus=None, ), mock_instrument_core.delay(0.5), ) @@ -273,7 +270,6 @@ def test_mix( rate=1, flow_rate=aspirate_flow_rate, in_place=True, - is_meniscus=None, ), mock_instrument_core.delay(0.2), mock_instrument_core.dispense( @@ -284,7 +280,6 @@ def test_mix( flow_rate=dispense_flow_rate, in_place=True, push_out=2.0, - is_meniscus=None, ), mock_instrument_core.delay(0.5), ) @@ -321,7 +316,6 @@ def test_mix_disabled( rate=1, flow_rate=aspirate_flow_rate, in_place=True, - is_meniscus=None, ), times=0, ) @@ -358,7 +352,6 @@ def test_pre_wet( rate=1, flow_rate=aspirate_flow_rate, in_place=True, - is_meniscus=None, ), mock_instrument_core.delay(0.2), mock_instrument_core.dispense( @@ -369,7 +362,6 @@ def test_pre_wet( flow_rate=dispense_flow_rate, in_place=True, push_out=0, - is_meniscus=None, ), mock_instrument_core.delay(0.5), ) @@ -404,7 +396,6 @@ def test_pre_wet_disabled( rate=1, flow_rate=aspirate_flow_rate, in_place=True, - is_meniscus=None, ), times=0, ) diff --git a/api/tests/opentrons/protocol_api/test_well.py b/api/tests/opentrons/protocol_api/test_well.py index fd9555fb3b9..1c4d3371426 100644 --- a/api/tests/opentrons/protocol_api/test_well.py +++ b/api/tests/opentrons/protocol_api/test_well.py @@ -104,7 +104,7 @@ def test_well_center(decoy: Decoy, mock_well_core: WellCore, subject: Well) -> N def test_well_meniscus(decoy: Decoy, mock_well_core: WellCore, subject: Well) -> None: """It should get a Location representing the meniscus of the well.""" - result = subject.meniscus(4.2) + result = subject.meniscus(z=4.2, target="end") assert isinstance(result, Location) assert result.point == Point(0, 0, 4.2) diff --git a/api/tests/opentrons/protocol_engine/state/test_geometry_view.py b/api/tests/opentrons/protocol_engine/state/test_geometry_view.py index 805c255fa60..23bd1bbfa0c 100644 --- a/api/tests/opentrons/protocol_engine/state/test_geometry_view.py +++ b/api/tests/opentrons/protocol_engine/state/test_geometry_view.py @@ -2002,7 +2002,10 @@ def test_get_relative_liquid_handling_well_location( subject: GeometryView, ) -> None: """It should get the relative location of a well given an absolute position.""" - result = subject.get_relative_liquid_handling_well_location( + ( + result, + dynamic_liquid_tracking, + ) = subject.get_relative_liquid_handling_well_location( labware_id="labware-id", well_name="B2", absolute_point=Point(x=0, y=0, z=-2),