Skip to content

Commit

Permalink
feat(shared-data, api): Add evo tips definition and restrictions on l…
Browse files Browse the repository at this point in the history
…oading
  • Loading branch information
Laura-Danielle committed Nov 6, 2024
1 parent ded3b90 commit 66da179
Show file tree
Hide file tree
Showing 5 changed files with 1,051 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/src/opentrons/protocol_api/core/engine/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def load_labware(
)
)
# FIXME(jbl, 2023-08-14) validating after loading the object issue
validation.ensure_labware_is_loadable(load_result.definition, load_location)
validation.ensure_definition_is_labware(load_result.definition)

# FIXME(mm, 2023-02-21):
Expand Down
20 changes: 19 additions & 1 deletion api/src/opentrons/protocol_api/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from opentrons_shared_data.labware.labware_definition import LabwareRole
from opentrons_shared_data.pipette.types import PipetteNameType
from opentrons_shared_data.robot.types import RobotType

from opentrons.protocol_engine.types import LabwareLocation, NonStackedLocation
from opentrons.protocols.api_support.types import APIVersion, ThermocyclerStep
from opentrons.protocols.api_support.util import APIVersionError
from opentrons.protocols.models import LabwareDefinition
Expand Down Expand Up @@ -83,6 +83,10 @@ class LabwareDefinitionIsNotLabwareError(ValueError):
"""An error raised when a labware is not loaded using `load_labware`."""


class LabwareDefinitionIsNotLoadableOnPosition(ValueError):
"""An error raised when a labware is not able to be loaded at the location."""


class InvalidTrashBinLocationError(ValueError):
"""An error raised when attempting to load trash bins in invalid slots."""

Expand Down Expand Up @@ -253,6 +257,20 @@ def ensure_definition_is_labware(definition: LabwareDefinition) -> None:
)


def ensure_labware_is_loadable(
definition: LabwareDefinition, location: LabwareLocation
) -> None:
"""Ensure that one of the definition's allowed roles is `stackableOnly` and that the location is a `NonStackedLocation`."""
if (
definition.allowedRoles
and LabwareRole.stackableOnly in definition.allowedRoles
and isinstance(location, NonStackedLocation)
):
raise LabwareDefinitionIsNotLoadableOnPosition(
f"Labware {definition.parameters.loadName} cannot be loaded on {location}."
)


_MODULE_ALIASES: Dict[str, ModuleModel] = {
"magdeck": MagneticModuleModel.MAGNETIC_V1,
"magnetic module": MagneticModuleModel.MAGNETIC_V1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,11 @@
"x": 0,
"y": 0,
"z": 16.1
},
"evo_flex_96_tiprack_adapter": {
"x": 0,
"y": 0,
"z": 102
}
},
"stackingOffsetWithModule": {
Expand Down
Loading

0 comments on commit 66da179

Please sign in to comment.