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 #17237

Open
wants to merge 3 commits into
base: chore_release-8.3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions api/src/opentrons/protocol_engine/commands/load_labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ async def execute(
)
state_update.set_addressable_area_used(area_name)
elif isinstance(params.location, DeckSlotLocation):
self._state_view.labware.raise_if_labware_cannot_be_ondeck(
labware_id=params.labwareId
)
self._state_view.addressable_areas.raise_if_area_not_in_deck_configuration(
params.location.slotName.id
)
Expand Down
6 changes: 6 additions & 0 deletions api/src/opentrons/protocol_engine/commands/move_labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ async def execute(self, params: MoveLabwareParams) -> _ExecuteReturn: # noqa: C
self._state_view.labware.raise_if_labware_has_labware_on_top(
labware_id=params.labwareId
)

if isinstance(available_new_location, DeckSlotLocation):
self._state_view.labware.raise_if_labware_cannot_be_ondeck(
labware_id=params.labwareId
)

if isinstance(available_new_location, OnLabwareLocation):
self._state_view.labware.raise_if_labware_has_labware_on_top(
available_new_location.labwareId
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 @@ -105,6 +106,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 @@ -44,6 +44,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
)


Comment on lines +47 to +54
Copy link
Contributor

Choose a reason for hiding this comment

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

This quirk is fine, however theres some parallel work going on with the lids behavior that introduced a new labware parameter called isDeckSlotCompatible that could be used for the same thing as this quirk. We'll be using it for the tiprack lids and any other lids that cannot be placed on deck, and in theory could use it here too, although it would need to be updated to apply to regular labware loads as well and not just lid stacks. Not a blocker but eventually we'll probably want to consolidate the two.

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 @@ -887,6 +887,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',
Copy link
Contributor

Choose a reason for hiding this comment

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

This stackingMaxFive quirk can go away now that its unused in place of the stackLimit and compatibleParentLabware fields.

'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"],
Copy link
Contributor

Choose a reason for hiding this comment

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

stackingMaxFive can be removed here, do we need to add a stackLimit to this labware? It's at the "bottom" of the stack so I think not?

"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