Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): differentiate instrument calibration calls #15768

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ async def pick_up_tip(
pipette_serial=self._state_view.pipettes.get_serial_number(pipette_id),
labware_definition=self._state_view.labware.get_definition(labware_id),
nominal_fallback=nominal_tip_geometry.length,
robot_type=self._state_view.config.robot_type,
)

await self._hardware_api.tip_pickup_moves(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from opentrons.protocols.labware import get_labware_definition

# TODO (lc 09-26-2022) We should conditionally import ot2 or ot3 calibration
from opentrons.hardware_control.instruments.ot2 import (
instrument_calibration as instr_cal,
)
from opentrons.hardware_control.instruments.ot3 import instrument_calibration as instr_cal_ot3
from opentrons.hardware_control.instruments.ot2 import instrument_calibration as instr_cal_ot2
from opentrons_shared_data.robot.dev_types import RobotType, RobotTypeEnum
from opentrons.calibration_storage.types import TipLengthCalNotFound


Expand Down Expand Up @@ -53,6 +53,7 @@ async def get_calibrated_tip_length(
pipette_serial: str,
labware_definition: LabwareDefinition,
nominal_fallback: float,
robot_type: RobotType,
) -> float:
"""Get the calibrated tip length of a tip rack / pipette pair.

Expand All @@ -64,18 +65,28 @@ async def get_calibrated_tip_length(
pipette_serial,
labware_definition,
nominal_fallback,
robot_type,
)

@staticmethod
def _get_calibrated_tip_length_sync(
pipette_serial: str,
labware_definition: LabwareDefinition,
nominal_fallback: float,
robot_type: RobotType,
) -> float:
try:
return instr_cal.load_tip_length_for_pipette(
pipette_serial, labware_definition
).tip_length
# load_tip_length_for_pipette method does not exist for ot3
# check pipette/labware compatability? (see load_pipette.py)
robot_type = RobotTypeEnum.robot_literal_to_enum(robot_type)
if robot_type == RobotTypeEnum.FLEX:
return instr_cal_ot3.load_tip_length_for_pipette(
pipette_serial, labware_definition
).tip_length
elif robot_type == RobotTypeEnum.OT2:
return instr_cal_ot2.load_tip_length_for_pipette(
pipette_serial, labware_definition
).tip_length

except TipLengthCalNotFound as e:
message = (
Expand Down
Loading