Skip to content
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

feat(shared-data, api): Add evo tips definition and restrictions on loading #16710

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from
Open
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
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
Loading