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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ async def execute(self, params: StoreParams) -> _ExecuteReturn:
stacker_state = self._state_view.modules.get_flex_stacker_substate(
params.moduleId
)

location = self._state_view.modules.get_location(params.moduleId)
pool_definitions = stacker_state.get_pool_definition_ordered_list()
if pool_definitions is None:
raise FlexStackerLabwarePoolNotYetDefinedError(
message=f"The Flex Stacker in {location} has not been configured yet and cannot be filled."
)

if (
len(stacker_state.contained_labware_bottom_first)
== stacker_state.max_pool_count
Expand All @@ -186,12 +193,6 @@ async def execute(self, params: StoreParams) -> _ExecuteReturn:
f"Cannot store labware in Flex Stacker in {location} because it is full"
)

pool_definitions = stacker_state.get_pool_definition_ordered_list()
if pool_definitions is None:
raise FlexStackerLabwarePoolNotYetDefinedError(
message=f"The Flex Stacker in {location} has not been configured yet and cannot be filled."
)

primary_id, maybe_adapter_id, maybe_lid_id = self._verify_labware_to_store(
params, stacker_state
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,17 @@ async def test_store_raises_if_carriage_logically_empty(
await subject.execute(data)


@pytest.mark.parametrize(
"contained_labware_count,max_pool_count",
[
(0, 0),
(1, 0),
(0, 1),
],
)
async def test_store_raises_if_not_configured(
contained_labware_count: int,
max_pool_count: int,
decoy: Decoy,
equipment: EquipmentHandler,
state_view: StateView,
Expand All @@ -151,8 +161,8 @@ async def test_store_raises_if_not_configured(
pool_primary_definition=None,
pool_adapter_definition=None,
pool_lid_definition=None,
contained_labware_bottom_first=_contained_labware(1),
max_pool_count=0,
contained_labware_bottom_first=_contained_labware(contained_labware_count),
max_pool_count=max_pool_count,
pool_overlap=0,
)
decoy.when(
Expand Down