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
5 changes: 4 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,6 @@
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.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 @@ -101,6 +100,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
2 changes: 2 additions & 0 deletions api/src/opentrons/protocol_engine/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
LiquidDoesNotExistError,
LabwareDefinitionDoesNotExistError,
LabwareCannotBeStackedError,
LabwareCannotSitOnDeckError,
LabwareIsInStackError,
LabwareOffsetDoesNotExistError,
LabwareIsNotTipRackError,
Expand Down Expand Up @@ -104,6 +105,7 @@
"LiquidDoesNotExistError",
"LabwareDefinitionDoesNotExistError",
"LabwareCannotBeStackedError",
"LabwareCannotSitOnDeckError",
"LabwareIsInStackError",
"LabwareOffsetDoesNotExistError",
"LabwareIsNotTipRackError",
Expand Down
13 changes: 13 additions & 0 deletions api/src/opentrons/protocol_engine/errors/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,19 @@ def __init__(
super().__init__(ErrorCodes.GENERAL_ERROR, message, details, wrapping)


class LabwareCannotSitOnDeckError(ProtocolEngineError):
"""Raised when a labware is incompatible with a deck slot."""

def __init__(
self,
message: Optional[str] = None,
details: Optional[Dict[str, Any]] = None,
wrapping: Optional[Sequence[EnumeratedError]] = None,
) -> None:
"""Build a LabwareCannotSitOnDeckError."""
super().__init__(ErrorCodes.GENERAL_ERROR, message, details, wrapping)


class LabwareIsInStackError(ProtocolEngineError):
"""Raised when trying to move to or physically interact with a labware that has another labware on top."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def validate_labware_can_be_stacked(
return below_labware_load_name in top_labware_definition.stackingOffsetWithLabware


def validate_labware_can_be_ondeck(definition: LabwareDefinition) -> bool:
"""Validate that the labware being loaded onto the deck can sit in a slot."""
return (
definition.parameters.quirks is None
or "stackingOnly" not in definition.parameters.quirks
)


def validate_gripper_compatible(definition: LabwareDefinition) -> bool:
"""Validate that the labware definition does not have a quirk disallowing movement with gripper."""
return (
Expand Down
13 changes: 13 additions & 0 deletions api/src/opentrons/protocol_engine/state/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,19 @@ def raise_if_labware_in_location(
f"Labware {labware.loadName} is already present at {location}."
)

def raise_if_labware_cannot_be_ondeck(
self,
location: OnDeckLabwareLocation,
labware_definition: LabwareDefinition,
) -> None:
"""Raise an error if the labware cannot be in the specified location."""
if isinstance(
location, (DeckSlotLocation, AddressableAreaLocation)
) and not labware_validation.validate_labware_can_be_ondeck(labware_definition):
raise errors.LabwareCannotSitOnDeckError(
f"{labware_definition.parameters.loadName} cannot sit in a slot by itself."
)

def raise_if_labware_incompatible_with_plate_reader(
self,
labware_definition: LabwareDefinition,
Expand Down
1 change: 1 addition & 0 deletions shared-data/js/__tests__/labwareDefQuirks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const EXPECTED_VALID_QUIRKS = [
'gripperIncompatible',
'tiprackAdapterFor96Channel',
'stackingMaxFive',
'stackingOnly',
]

describe('check quirks for all labware defs', () => {
Expand Down
6 changes: 6 additions & 0 deletions shared-data/js/labware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ import thermoscientificnunc96Wellplate2000UlV1Uncasted from '../labware/definiti
import tipone96Tiprack200UlV1Uncasted from '../labware/definitions/2/tipone_96_tiprack_200ul/1.json'
import usascientific12Reservoir22MlV1Uncasted from '../labware/definitions/2/usascientific_12_reservoir_22ml/1.json'
import usascientific96Wellplate24MlDeepV1Uncasted from '../labware/definitions/2/usascientific_96_wellplate_2.4ml_deep/1.json'
import evotipsFlex96TiprackAdapterV1Uncasted from '../labware/definitions/2/evotips_flex_96_tiprack_adapter/1.json'
import evotipsOpentrons96LabwareV1Uncasted from '../labware/definitions/2/evotips_opentrons_96_labware/1.json'

// v1 legacy labware definitions

Expand Down Expand Up @@ -297,6 +299,8 @@ const thermoscientificnunc96Wellplate2000UlV1 = thermoscientificnunc96Wellplate2
const tipone96Tiprack200UlV1 = tipone96Tiprack200UlV1Uncasted as LabwareDefinition2
const usascientific12Reservoir22MlV1 = usascientific12Reservoir22MlV1Uncasted as LabwareDefinition2
const usascientific96Wellplate24MlDeepV1 = usascientific96Wellplate24MlDeepV1Uncasted as LabwareDefinition2
const evotipsFlex96TiprackAdapterV1 = evotipsFlex96TiprackAdapterV1Uncasted as LabwareDefinition2
const evotipsOpentrons96LabwareV1 = evotipsOpentrons96LabwareV1Uncasted as LabwareDefinition2

// cast v1 defs

Expand Down Expand Up @@ -466,6 +470,8 @@ const latestDefs = {
tipone96Tiprack200UlV1,
usascientific12Reservoir22MlV1,
usascientific96Wellplate24MlDeepV1,
evotipsFlex96TiprackAdapterV1,
evotipsOpentrons96LabwareV1,
}
// labware definitions
const getAllLabwareDefs = (): Record<
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"ordering": [],
"brand": {
"brand": "Opentrons",
"brandId": []
},
"metadata": {
"displayName": "Evotips adapter",
"displayCategory": "adapter",
"displayVolumeUnits": "\u00b5L",
"tags": []
},
"dimensions": {
"xDimension": 156.5,
"yDimension": 105,
"zDimension": 132
},
"wells": {},
"groups": [
{
"metadata": {},
"wells": []
}
],
"parameters": {
"format": "96Standard",
"quirks": ["tiprackAdapterFor96Channel", "stackingMaxFive"],
"isTiprack": false,
"isMagneticModuleCompatible": false,
"loadName": "evotips_flex_96_tiprack_adapter"
},
"namespace": "opentrons",
"version": 1,
"schemaVersion": 2,
"allowedRoles": ["adapter"],
"cornerOffsetFromSlot": {
"x": -14.25,
"y": -3.5,
"z": 0
}
}
Loading
Loading