Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 106 additions & 84 deletions api/src/opentrons/protocol_api/_liquid_properties.py

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions api/src/opentrons/protocol_api/core/engine/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -1962,8 +1962,8 @@ def aspirate_liquid_class(
aspirate_point = (
tx_comps_executor.absolute_point_from_position_reference_and_offset(
well=source_well,
position_reference=aspirate_props.position_reference,
offset=aspirate_props.offset,
position_reference=aspirate_props.aspirate_position.position_reference,
offset=aspirate_props.aspirate_position.offset,
)
)
aspirate_location = Location(aspirate_point, labware=source_loc.labware)
Expand Down Expand Up @@ -2073,8 +2073,8 @@ def dispense_liquid_class(
dispense_point = (
tx_comps_executor.absolute_point_from_position_reference_and_offset(
well=dest_well,
position_reference=dispense_props.position_reference,
offset=dispense_props.offset,
position_reference=dispense_props.dispense_position.position_reference,
offset=dispense_props.dispense_position.offset,
)
)
dispense_location = Location(dispense_point, labware=dest_loc.labware)
Expand Down Expand Up @@ -2155,8 +2155,8 @@ def dispense_liquid_class_during_multi_dispense(
dispense_point = (
tx_comps_executor.absolute_point_from_position_reference_and_offset(
well=dest_well,
position_reference=dispense_props.position_reference,
offset=dispense_props.offset,
position_reference=dispense_props.dispense_position.position_reference,
offset=dispense_props.dispense_position.offset,
)
)
dispense_location = Location(dispense_point, labware=dest_loc.labware)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def submerge(
"""
submerge_start_point = absolute_point_from_position_reference_and_offset(
well=self._target_well,
position_reference=submerge_properties.position_reference,
offset=submerge_properties.offset,
position_reference=submerge_properties.start_position.position_reference,
offset=submerge_properties.start_position.offset,
)
submerge_start_location = Location(
point=submerge_start_point, labware=self._target_location.labware
Expand Down Expand Up @@ -332,8 +332,8 @@ def retract_after_aspiration(
retract_props = self._transfer_properties.aspirate.retract
retract_point = absolute_point_from_position_reference_and_offset(
well=self._target_well,
position_reference=retract_props.position_reference,
offset=retract_props.offset,
position_reference=retract_props.end_position.position_reference,
offset=retract_props.end_position.offset,
)
retract_location = Location(
retract_point, labware=self._target_location.labware
Expand Down Expand Up @@ -363,15 +363,15 @@ def retract_after_aspiration(
assert (
touch_tip_props.speed is not None
and touch_tip_props.z_offset is not None
and touch_tip_props.mm_to_edge is not None
and touch_tip_props.mm_from_edge is not None
)
self._instrument.touch_tip(
location=retract_location,
well_core=self._target_well,
radius=1,
z_offset=touch_tip_props.z_offset,
speed=touch_tip_props.speed,
mm_from_edge=touch_tip_props.mm_to_edge,
mm_from_edge=touch_tip_props.mm_from_edge,
)
self._instrument.move_to(
location=retract_location,
Expand Down Expand Up @@ -429,8 +429,8 @@ def retract_after_dispensing(
retract_props = self._transfer_properties.dispense.retract
retract_point = absolute_point_from_position_reference_and_offset(
well=self._target_well,
position_reference=retract_props.position_reference,
offset=retract_props.offset,
position_reference=retract_props.end_position.position_reference,
offset=retract_props.end_position.offset,
)
retract_location = Location(
retract_point, labware=self._target_location.labware
Expand Down Expand Up @@ -568,8 +568,8 @@ def retract_during_multi_dispensing(
retract_props = self._transfer_properties.multi_dispense.retract
retract_point = absolute_point_from_position_reference_and_offset(
well=self._target_well,
position_reference=retract_props.position_reference,
offset=retract_props.offset,
position_reference=retract_props.end_position.position_reference,
offset=retract_props.end_position.offset,
)
retract_location = Location(
retract_point, labware=self._target_location.labware
Expand Down Expand Up @@ -724,7 +724,7 @@ def _do_touch_tip_and_air_gap(
assert (
touch_tip_properties.speed is not None
and touch_tip_properties.z_offset is not None
and touch_tip_properties.mm_to_edge is not None
and touch_tip_properties.mm_from_edge is not None
)
# TODO:, check that when blow out is a non-dest-well,
# whether the touch tip params from transfer props should be used for
Expand All @@ -737,7 +737,7 @@ def _do_touch_tip_and_air_gap(
radius=1,
z_offset=touch_tip_properties.z_offset,
speed=touch_tip_properties.speed,
mm_from_edge=touch_tip_properties.mm_to_edge,
mm_from_edge=touch_tip_properties.mm_from_edge,
)
except TouchTipDisabledError:
# TODO: log a warning
Expand Down
2 changes: 1 addition & 1 deletion api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def touch_tip( # noqa: C901
``None``. This should happen if ``touch_tip`` is called
without first calling a method that takes a location, like
:py:meth:`.aspirate` or :py:meth:`dispense`.
:raises: ValueError: If both ``mm_to_edge`` and ``radius`` are specified.
:raises: ValueError: If both ``mm_from_edge`` and ``radius`` are specified.
:returns: This instance.

.. versionchanged:: 2.24
Expand Down
97 changes: 64 additions & 33 deletions api/tests/opentrons/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
ByTipTypeSetting,
AspirateProperties,
Submerge,
TipPosition,
PositionReference,
DelayProperties,
DelayParams,
Expand Down Expand Up @@ -818,23 +819,29 @@ def minimal_liquid_class_def2() -> LiquidClassSchemaV1:
tiprack="opentrons_flex_96_tiprack_50ul",
aspirate=AspirateProperties(
submerge=Submerge(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=-5),
startPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=-5),
),
speed=100,
delay=DelayProperties(
enable=True, params=DelayParams(duration=1.5)
),
),
retract=RetractAspirate(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=5),
endPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=5),
),
speed=100,
airGapByVolume=[(5.0, 3.0), (10.0, 4.0)],
touchTip=TouchTipProperties(enable=False),
delay=DelayProperties(enable=False),
),
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=0, y=0, z=-5),
aspiratePosition=TipPosition(
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=0, y=0, z=-5),
),
flowRateByVolume=[(10.0, 40.0), (20.0, 30.0)],
correctionByVolume=[(15.0, 1.5), (30.0, -5.0)],
preWet=True,
Expand All @@ -845,22 +852,28 @@ def minimal_liquid_class_def2() -> LiquidClassSchemaV1:
),
singleDispense=SingleDispenseProperties(
submerge=Submerge(
positionReference=PositionReference.LIQUID_MENISCUS,
offset=Coordinate(x=0, y=0, z=-5),
startPosition=TipPosition(
positionReference=PositionReference.LIQUID_MENISCUS,
offset=Coordinate(x=0, y=0, z=-5),
),
speed=100,
delay=DelayProperties(enable=False),
),
retract=RetractDispense(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=5),
endPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=5),
),
speed=100,
airGapByVolume=[(5.0, 3.0), (10.0, 4.0)],
blowout=BlowoutProperties(enable=False),
touchTip=TouchTipProperties(enable=False),
delay=DelayProperties(enable=False),
),
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=0, y=0, z=-5),
dispensePosition=TipPosition(
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=0, y=0, z=-5),
),
flowRateByVolume=[(10.0, 40.0), (20.0, 30.0)],
correctionByVolume=[(15.0, -1.5), (30.0, 5.0)],
mix=MixProperties(enable=False),
Expand Down Expand Up @@ -892,30 +905,36 @@ def maximal_liquid_class_def() -> LiquidClassSchemaV1:
tiprack="opentrons_flex_96_tiprack_50ul",
aspirate=AspirateProperties(
submerge=Submerge(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=1, y=2, z=3),
startPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=1, y=2, z=3),
),
speed=100,
delay=DelayProperties(
enable=True, params=DelayParams(duration=10.0)
),
),
retract=RetractAspirate(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=3, y=2, z=1),
endPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=3, y=2, z=1),
),
speed=50,
airGapByVolume=[(1.0, 0.1), (49.9, 0.1), (50.0, 0.0)],
touchTip=TouchTipProperties(
enable=True,
params=LiquidClassTouchTipParams(
zOffset=-1, mmToEdge=0.5, speed=30
zOffset=-1, mmFromEdge=0.5, speed=30
),
),
delay=DelayProperties(
enable=True, params=DelayParams(duration=20)
),
),
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=10, y=20, z=30),
aspiratePosition=TipPosition(
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=10, y=20, z=30),
),
flowRateByVolume=[(1.0, 35.0), (10.0, 24.0), (50.0, 35.0)],
correctionByVolume=[(0.0, 0.0)],
preWet=True,
Expand All @@ -928,16 +947,20 @@ def maximal_liquid_class_def() -> LiquidClassSchemaV1:
),
singleDispense=SingleDispenseProperties(
submerge=Submerge(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=30, y=20, z=10),
startPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=30, y=20, z=10),
),
speed=100,
delay=DelayProperties(
enable=True, params=DelayParams(duration=0.0)
),
),
retract=RetractDispense(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=11, y=22, z=33),
endPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=11, y=22, z=33),
),
speed=50,
airGapByVolume=[(1.0, 0.1), (49.9, 0.1), (50.0, 0.0)],
blowout=BlowoutProperties(
Expand All @@ -950,15 +973,17 @@ def maximal_liquid_class_def() -> LiquidClassSchemaV1:
touchTip=TouchTipProperties(
enable=True,
params=LiquidClassTouchTipParams(
zOffset=-1, mmToEdge=0.75, speed=30
zOffset=-1, mmFromEdge=0.75, speed=30
),
),
delay=DelayProperties(
enable=True, params=DelayParams(duration=10)
),
),
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=33, y=22, z=11),
dispensePosition=TipPosition(
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=33, y=22, z=11),
),
flowRateByVolume=[(1.0, 50.0)],
correctionByVolume=[(0.0, 0.0)],
mix=MixProperties(
Expand All @@ -977,16 +1002,20 @@ def maximal_liquid_class_def() -> LiquidClassSchemaV1:
),
multiDispense=MultiDispenseProperties(
submerge=Submerge(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=2),
startPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=0, y=0, z=2),
),
speed=100,
delay=DelayProperties(
enable=False, params=DelayParams(duration=0.0)
),
),
retract=RetractDispense(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=2, y=3, z=1),
endPosition=TipPosition(
positionReference=PositionReference.WELL_TOP,
offset=Coordinate(x=2, y=3, z=1),
),
speed=50,
airGapByVolume=[(1.0, 0.1), (49.9, 0.1), (50.0, 0.0)],
blowout=BlowoutProperties(
Expand All @@ -999,15 +1028,17 @@ def maximal_liquid_class_def() -> LiquidClassSchemaV1:
touchTip=TouchTipProperties(
enable=False,
params=LiquidClassTouchTipParams(
zOffset=-1, mmToEdge=0.5, speed=30
zOffset=-1, mmFromEdge=0.5, speed=30
),
),
delay=DelayProperties(
enable=False, params=DelayParams(duration=0)
),
),
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=1, y=3, z=2),
dispensePosition=TipPosition(
positionReference=PositionReference.WELL_BOTTOM,
offset=Coordinate(x=1, y=3, z=2),
),
flowRateByVolume=[(50.0, 50.0)],
correctionByVolume=[(0.0, 0.0)],
conditioningByVolume=[(1.0, 5.0), (45.0, 5.0), (50.0, 0.0)],
Expand Down
Loading
Loading