Skip to content

fix(api): flex stacker store command should check labware configuration before hopper labware count #18176

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

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

ahiuchingau
Copy link
Contributor

Overview

If you tried to store a labware in a stacker without previously setting the labware configuration, the protocol would fail with

CannotPerformModuleAction: Cannot store labware in Flex Stacker in slotName=<> because it is full

This is not true because there should be nothing in the stacker at this point. This PR fixes this misleading error by check that there's a labware configuration first, before validating the labware count in the hopper.

Test protocol

from opentrons.protocol_api import ProtocolContext, ParameterContext
from opentrons.protocol_api.module_contexts import (
    FlexStackerContext,
)

metadata = {
    "protocolName": "Flex Stacker DVT",
    "author": "Opentrons <protocols@opentrons.com>",
}
requirements = {
    "robotType": "Flex",
    "apiLevel": "2.24",
}


def run(protocol: ProtocolContext) -> None:
    """Protocol."""
    labware_name = "nest_96_wellplate_200ul_flat"
    labware_count = 3
    # ======================= SIMPLE SETUP ARRANGEMENT ======================
    stacker_A = protocol.load_module( "flexStackerModuleV1", "D4")
    stacker_A.set_stored_labware(
        load_name=labware_name,
        count=labware_count
    )
    
    stacker_B = protocol.load_module( "flexStackerModuleV1", "C4")

    labware_stack = stacker_A.retrieve()
    protocol.move_labware(labware_stack, stacker_B, True)
    stacker_B.store()

The error message should now make more sense:

FlexStackerLabwarePoolNotYetDefinedError: The Flex Stacker in slotName=<> has not been configured yet and cannot be filled.

@ahiuchingau ahiuchingau requested a review from a team as a code owner April 24, 2025 21:36
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.

Oops sorry!

Let's add a test though

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 please

@ahiuchingau ahiuchingau requested a review from sfoster1 April 25, 2025 17:51
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.

hooray! ty

@ahiuchingau ahiuchingau merged commit c3caad3 into edge Apr 25, 2025
24 checks passed
@ahiuchingau ahiuchingau deleted the fix_error-order-flex-stacker-store branch April 25, 2025 18:53
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