Skip to content

fix(api): Ensure parent to lid stack is valid source for move lid action#19574

Merged
CaseyBatten merged 3 commits intochore_release-8.7.0from
resc_498_lid_stacking_allocation_fix
Sep 16, 2025
Merged

fix(api): Ensure parent to lid stack is valid source for move lid action#19574
CaseyBatten merged 3 commits intochore_release-8.7.0from
resc_498_lid_stacking_allocation_fix

Conversation

@CaseyBatten
Copy link
Copy Markdown
Contributor

@CaseyBatten CaseyBatten commented Sep 16, 2025

Overview

Partially covers RESC-498

In testing the protocol related to the issue in the ticket mentioned, it was discovered that if a user supplies the parent labware to a dynamically allocated lid stack as a source for a move_lid command then they will get an error. Providing labware as a source for a lid stack is something that our API allows, but in the case of dynamically created stacks it was not working. This PR fixes that by allowing the move_lid logic to identify lid stacks by their relative parent as an extension of their base behavior.

Test Plan and Hands on Testing

  • Implement unit test to enforce behavior
  • The following protocol should pass analysis:
def run(protocol: protocol_api.ProtocolContext):
    dest_plate_1 = protocol.load_labware("corning_96_wellplate_360ul_flat", location="A2", lid ="corning_96_wellplate_360ul_flat_lid")
    dest_plate_2 = protocol.load_labware("corning_96_wellplate_360ul_flat", location="A3", lid ="corning_96_wellplate_360ul_flat_lid")
    dest_plate_3 = protocol.load_labware("corning_96_wellplate_360ul_flat", location="B1", lid ="corning_96_wellplate_360ul_flat_lid")
    dest_plate_4 = protocol.load_labware("corning_96_wellplate_360ul_flat", location="B2", lid ="corning_96_wellplate_360ul_flat_lid")

    # Riser labware to host lid stacks
    riser = protocol.load_adapter("opentrons_flex_deck_riser", location="B4")
    
    # Move lids to the stack
    protocol.move_lid(dest_plate_1, riser, use_gripper=True)
    protocol.move_lid(dest_plate_2, riser, use_gripper=True)
    protocol.move_lid(dest_plate_3, riser, use_gripper=True)
    protocol.move_lid(dest_plate_4, riser, use_gripper=True)

    # Move lids back off the stack by referencing parent labware
    protocol.move_lid(riser, dest_plate_1, True)
    protocol.move_lid(riser, dest_plate_2, True)
    protocol.move_lid(riser, dest_plate_3, True)
    protocol.move_lid(riser, dest_plate_4, True)

Changelog

Update move_lid function to correctly identify child lid stacks by a given parent labware

Review requests

Risk assessment

Med/Low - Fixes an existing bug regarding acceptable fields for the move_lid command

Copy link
Copy Markdown
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, looks good to me. I think we can integrate the labware display name into the error message a little more nicely

lid_id = lid.id
else:
raise ValueError(
f"Cannot move a lid off of a labware with no lid. {labware.get_display_name()}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
f"Cannot move a lid off of a labware with no lid. {labware.get_display_name()}"
f"Cannot move a lid off of {labware.get_display_name()} because it has no lid."

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah absolutely, good catch. Thats definitely a left over message format from debugging on my end.

@CaseyBatten CaseyBatten merged commit 4c689f8 into chore_release-8.7.0 Sep 16, 2025
44 checks passed
@CaseyBatten CaseyBatten deleted the resc_498_lid_stacking_allocation_fix branch September 16, 2025 20:17
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