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

refactor(api): wire protocol engine pick_up_tip to new hardware control function #15469

Merged

Conversation

caila-marashaj
Copy link
Contributor

@caila-marashaj caila-marashaj commented Jun 20, 2024

Overview

Hardware control now has a tip_pickup_moves function, which is just the most immediate movement required to pick up a tip, and unlike pick_up_tip, does not cache a tip in the pipette handler or prepare the pipette for aspiration.

This code changes the protocol engine's pick_up_tip command to use this new function if a flex is executing the command, and does not change the behavior for an ot2.

Test Plan

  • Test tip pickup on an ot2 and make sure behavior hasn't changed
  • Verify that a flex can now retry tip pickup multiple times in error recovery, and then proceed with a protocol once tips are present

@caila-marashaj caila-marashaj requested a review from a team as a code owner June 20, 2024 15:55
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests tests tests! But it lookks good to me otherwise.

@caila-marashaj caila-marashaj force-pushed the make-pick-up-tip-command-use-new-hw-control-function branch from 78b733a to fe6a2b2 Compare June 24, 2024 14:47
Comment on lines 90 to 91
try:
from opentrons.hardware_control.ot3api import OT3API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only need to wrap the import statement in the try. The rest of the test logic can be outside the try-except.
Also, is this how we normally run Flex-only tests? Or should the ot3_only mark be used and it can be expected the import will always work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try it with the ot3_only mark, yeah

increment=None,
)
await self.verify_tip_presence(pipette_id, TipPresenceStatus.PRESENT)
if self._state_view.config.robot_type == "OT-3 Standard":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why we need to do this if/else on robot_type? Does the OT-2 HWAPI not behave the same way as the OT-3 HWAPI?

Copy link
Contributor Author

@caila-marashaj caila-marashaj Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we don't want to run verify_tip_presence for an ot2. We pretty much just want to run the old pick_up_tip if we have an ot2, and then unconditionally cache the tip.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this code is calling verify_tip_presence() on an OT-2, isn't it? Down on line 197?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah you're right I think this actually is compatible with ot2

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make the ot-2 stuff more similar to the flex stuff which will reduce complexity

@@ -1152,7 +1152,7 @@ async def update_nozzle_configuration_for_mount(
mount, back_left_nozzle, front_right_nozzle, starting_nozzle
)

async def tip_pickup_moves(
async def _tip_pickup_moves(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be a public function, no reason not to really

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this have a cache_tip already also? if not, should add that too

Comment on lines 90 to 91
try:
from opentrons.hardware_control.ot3api import OT3API
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try it with the ot3_only mark, yeah

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, nice!

@caila-marashaj caila-marashaj force-pushed the make-pick-up-tip-command-use-new-hw-control-function branch from d8ba446 to 46fb25f Compare June 25, 2024 18:36
Copy link
Contributor

A PR has been opened to address analyses snapshot changes. Please review the changes here: #15513

Copy link
Contributor

A PR has been opened to address analyses snapshot changes. Please review the changes here: #15513

@caila-marashaj caila-marashaj requested a review from a team as a code owner June 25, 2024 19:22
@caila-marashaj caila-marashaj force-pushed the make-pick-up-tip-command-use-new-hw-control-function branch from b8addd5 to e5d1d46 Compare June 25, 2024 19:23
Copy link
Contributor

A PR has been opened to address analyses snapshot changes. Please review the changes here: #15517

@caila-marashaj caila-marashaj merged commit cdbc6c1 into edge Jun 25, 2024
35 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants