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(app): Update tip detection logic #15955

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

mjhuff
Copy link
Contributor

@mjhuff mjhuff commented Aug 9, 2024

Closes RQA-2935

Overview

Now, whenever a protocol run ends, show drop tip CTAs if the run command history shows the run ended with tips attached, even if this was intentionally done by the user (intentional in the sense of the protocol never explicitly specifying a drop tip before the run ends).

All the changes here really occur in getPipettesWithTipAttached, and there are two:

  • The aforementioned change.
  • Don't use the Flex sensors anymore, since in practice, it's difficult to ensure the data we get isn't stale without delaying action for a bit.

Note that the run failure behavior and error recovery behavior remains the same.

Test Plan and Hands on Testing

  • Verified the above behavior using the following protocols:

Case 1, the client doesn't explicitly drop tips in their protocol (show the CTAs):

from opentrons import protocol_api

# metadata
metadata = {
    "protocolName": "Pick up tip with no return",
    "author": "Name <[email protected]>",
    "description": "Simple protocol to get started using the Flex",
}

# requirements
requirements = {"robotType": "Flex", "apiLevel": "2.15"}


# protocol run function
def run(protocol: protocol_api.ProtocolContext):
    tiprack_left = protocol.load_labware(
        load_name="opentrons_flex_96_tiprack_1000ul", location="C2"
    )
    left_pipette = protocol.load_instrument(
        instrument_name="flex_8channel_1000", mount="left", tip_racks=[tiprack_left]
    )
    left_pipette.pick_up_tip()


Case 2, the client does explicitly drop tips in their protocol (don't show the CTAs):

from opentrons import protocol_api

# metadata
metadata = {
    "protocolName": "Pick up tip",
    "author": "Name <[email protected]>",
    "description": "Simple protocol to get started using the Flex",
}

# requirements
requirements = {"robotType": "Flex", "apiLevel": "2.15"}


# protocol run function
def run(protocol: protocol_api.ProtocolContext):
    tiprack_left = protocol.load_labware(
        load_name="opentrons_flex_96_tiprack_200ul", location="D1"
    )
    left_pipette = protocol.load_instrument(
        instrument_name="flex_1channel_1000", mount="left", tip_racks=[tiprack_left]
    )
    left_pipette.pick_up_tip()
    left_pipette.return_tip()

Changelog

  • Drop tip CTAs now properly display at the end of a run based on tip state.

Review requests

@SyntaxColoring points out that at the end of a run, the robot implictly drops the tip without an explicit drop tip at the end of a protocol:

  • The E-stop was pressed
  • The run loaded no obvious trash where we can drop them
  • The run was stopped by the user, as opposed to erroring or completing naturally

Knowing this, are we still ok nagging the users with drop tip CTAs despite the tips not actually being there?

Risk assessment

low with the caveat mentioned in review requests

@mjhuff mjhuff requested review from sfoster1 and a team August 9, 2024 17:13
@mjhuff mjhuff requested a review from a team as a code owner August 9, 2024 17:13
@mjhuff mjhuff requested review from TamarZanzouri and removed request for a team August 9, 2024 17:13
@mjhuff
Copy link
Contributor Author

mjhuff commented Aug 9, 2024

Woops, only the last commit is the real commit. Ignore the other ones while I fix this.

@mjhuff mjhuff force-pushed the app_update-tip-detection branch 2 times, most recently from 8133e85 to f75c529 Compare August 9, 2024 17:22
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 want to keep the "or if the command failed" logic.

I think also that the automatic post-run droptip could maybe not exist if we're makign things this mandatory, and alternately that if it does exist maybe we should do it by dispatching fixit commands from the orchestrator to make it get picked up by this logic (not for this release, though - for this release I'm ok with it). What do you think @SyntaxColoring

@mjhuff mjhuff requested a review from sfoster1 August 9, 2024 19:31
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.

Nice, makes sense to me!

@mjhuff mjhuff merged commit def8db3 into chore_release-8.0.0 Aug 9, 2024
20 checks passed
@mjhuff mjhuff deleted the app_update-tip-detection branch August 9, 2024 20:07
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.

2 participants