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

feat(api, shared-data): Move lid command implementation #17259

Merged
merged 14 commits into from
Jan 17, 2025

Conversation

CaseyBatten
Copy link
Contributor

@CaseyBatten CaseyBatten commented Jan 13, 2025

Overview

Covers EXEC-1005

Introduce move_lid() command to PAPI. Allows the movement of lids from stacks and source labware to destination labwares, stacks, or trash location. When a lid stack is emptied, it is moved to the new "systemLocation" location.

Test Plan and Hands on Testing

  • The following protocol should pass analysis and execute on a robot:
from typing import List, Dict, Any, Optional
from opentrons.protocol_api import ProtocolContext, Labware

metadata = {"protocolName": "Opentrons Flex Deck Riser with TC Lids Test"}
requirements = {"robotType": "Flex", "apiLevel": "2.23"}

LID_DEFINITION = "opentrons_tough_pcr_auto_sealing_lid"
DECK_RISER_NAME = "opentrons_flex_deck_riser"
USING_THERMOCYCLER = True

def run(protocol: ProtocolContext):
    # SETUP
    deck_riser_adapter = protocol.load_adapter(DECK_RISER_NAME, "A2")
    trash = protocol.load_trash_bin("A3")

    stack = protocol.load_lid_stack(LID_DEFINITION, "B2", 5)
    
    thermocycler = protocol.load_module("thermocyclerModuleV2")
    thermocycler.open_lid()
    plate_in_cycler = thermocycler.load_labware("armadillo_96_wellplate_200ul_pcr_full_skirt")


    protocol.move_lid(stack, plate_in_cycler, True)

    # Move the lid to the empty riser, creating a new lid stack
    used_stack = protocol.move_lid(plate_in_cycler, deck_riser_adapter, True)
    protocol.move_lid(stack, plate_in_cycler, True)
    protocol.move_lid(plate_in_cycler, used_stack, True)
    protocol.move_lid(stack, plate_in_cycler, True)
    protocol.move_lid(plate_in_cycler, used_stack, True)
    protocol.move_lid(stack, plate_in_cycler, True)
    protocol.move_lid(plate_in_cycler, used_stack, True)
    protocol.move_lid(stack, plate_in_cycler, True)
    protocol.move_lid(plate_in_cycler, used_stack, True)

    # Trash all the lids
    protocol.move_lid(used_stack, trash, True)
    protocol.move_lid(used_stack, trash, True)
    protocol.move_lid(used_stack, trash, True)
    protocol.move_lid(used_stack, trash, True)
    protocol.move_lid(used_stack, trash, True)

Changelog

Introduces new move_lid() PAPI commands, alongside new state update commands to allow for lid updating and lid stack invalidation.

Review requests

Does the approach to returning Labware or None for move lid make sense when we're dealing with creating a new lid stack by moving a lid? The thought process here is:

  1. I have a lid stack in A1
  2. I move a lid from the lid stack in A1 to an empty deck slot in A2
  3. I have de facto created a new lid stack in A2, so I should create a stack there and return it to the user for handling
  4. If no new stack has been created at the lid's new position, I should return Nothing

Risk assessment

Low, new behavior and it gated behind API 2.23. Also impossible to use on earlier API versions anyways given the lack of Lid labware IDs on parent labwares, lack of lid stacks, and lack of the optional lid field on labwares.

@CaseyBatten CaseyBatten requested review from a team as code owners January 13, 2025 23:25
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.

This makes sense to me, yeah. This is a lot of code that's now in both move labware and move lid, can we factor some of it into something common?

Copy link
Contributor Author

@CaseyBatten CaseyBatten left a comment

Choose a reason for hiding this comment

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

Note: Refactoring based on discussion regarding client and PD needs for load lid stack -> move labware -> move lid -> move labware command execution stackup.

@CaseyBatten CaseyBatten requested a review from a team as a code owner January 16, 2025 20:05
@CaseyBatten CaseyBatten requested review from smb2268 and removed request for a team January 16, 2025 20:05
@CaseyBatten CaseyBatten added the gen-analyses-snapshot-pr Generate a healing PR if the analyses snapshot test fails label Jan 17, 2025
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

…snapshots (#17299)

This PR was requested on the PRhttps://github.com//pull/17259
Update snapshot tests to reflect TC lid compatible parents
@CaseyBatten CaseyBatten merged commit 7393c92 into edge Jan 17, 2025
61 checks passed
@CaseyBatten CaseyBatten deleted the move_lid_command_implementation branch January 17, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gen-analyses-snapshot-pr Generate a healing PR if the analyses snapshot test fails
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants