Skip to content

Commit

Permalink
remove restriction for multiple labwares stacked in a module
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleon95 authored and andySigler committed Mar 11, 2024
1 parent de0177d commit e1ac648
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
7 changes: 0 additions & 7 deletions api/src/opentrons/protocol_engine/state/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,6 @@ def raise_if_labware_cannot_be_stacked(
raise errors.LabwareCannotBeStackedError(
f"Labware {top_labware_definition.parameters.loadName} cannot be loaded onto labware {below_labware.loadName}"
)
elif isinstance(below_labware.location, ModuleLocation):
below_definition = self.get_definition(labware_id=below_labware.id)
if not labware_validation.validate_definition_is_adapter(below_definition):
raise errors.LabwareCannotBeStackedError(
f"Labware {top_labware_definition.parameters.loadName} cannot be loaded"
f" onto a labware on top of a module"
)
elif isinstance(below_labware.location, OnLabwareLocation):
further_below_definition = self.get_definition(
labware_id=below_labware.location.labwareId
Expand Down
32 changes: 0 additions & 32 deletions api/tests/opentrons/protocol_engine/state/test_labware_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,38 +1334,6 @@ def test_raise_if_labware_cannot_be_stacked_not_validated() -> None:
)


def test_raise_if_labware_cannot_be_stacked_on_module_not_adapter() -> None:
"""It should raise if the below labware on a module is not an adapter."""
subject = get_labware_view(
labware_by_id={
"labware-id": LoadedLabware(
id="labware-id",
loadName="test",
definitionUri="def-uri",
location=ModuleLocation(moduleId="module-id"),
)
},
definitions_by_uri={
"def-uri": LabwareDefinition.construct( # type: ignore[call-arg]
allowedRoles=[LabwareRole.labware]
)
},
)

with pytest.raises(errors.LabwareCannotBeStackedError, match="module"):
subject.raise_if_labware_cannot_be_stacked(
top_labware_definition=LabwareDefinition.construct( # type: ignore[call-arg]
parameters=Parameters.construct( # type: ignore[call-arg]
loadName="name"
),
stackingOffsetWithLabware={
"test": SharedDataOverlapOffset(x=0, y=0, z=0)
},
),
bottom_labware_id="labware-id",
)


def test_raise_if_labware_cannot_be_stacked_on_labware_on_adapter() -> None:
"""It should raise if the OnLabware location is on an adapter."""
subject = get_labware_view(
Expand Down

0 comments on commit e1ac648

Please sign in to comment.