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 8 commits into
base: edge
Choose a base branch
from
Next Next commit
feat(shared-data, api): Add evo tips definition and restrictions on l…
…oading
Laura-Danielle committed Dec 12, 2024
commit 98278838123818cb3115e67920c93290753f9fad
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
@@ -231,6 +231,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):
20 changes: 19 additions & 1 deletion api/src/opentrons/protocol_api/validation.py
Original file line number Diff line number Diff line change
@@ -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
@@ -101,6 +101,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."""

@@ -363,6 +367,20 @@ def ensure_definition_is_labware(definition: LabwareDefinition) -> None:
)


def ensure_labware_is_loadable(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wants to be in the engine I reckon

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,
Original file line number Diff line number Diff line change
@@ -1130,6 +1130,11 @@
"x": 0,
"y": 0,
"z": 16.1
},
"evo_flex_96_tiprack_adapter": {
"x": 0,
"y": 0,
"z": 102
}
},
"stackingOffsetWithModule": {
1,025 changes: 1,025 additions & 0 deletions shared-data/labware/definitions/2/opentrons_evo_96_wellplate_300ul/1.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -125,6 +125,7 @@ class LabwareRole(str, Enum):
fixture = "fixture"
adapter = "adapter"
maintenance = "maintenance"
stackableOnly = "stackableOnly"
lid = "lid"