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

fix(api,shared-data): Correct addressable area positions #14100

Merged
Merged
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
9 changes: 5 additions & 4 deletions api/src/opentrons/protocol_api/core/engine/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,11 @@ def _move_to_disposal_location(
addressable_area_name = disposal_location._addressable_area_name
if isinstance(disposal_location, WasteChute):
num_channels = self.get_channels()
if num_channels == 96:
addressable_area_name = "96ChannelWasteChute"
else:
addressable_area_name = "1and8ChannelWasteChute"
addressable_area_name = {
1: "1ChannelWasteChute",
8: "8ChannelWasteChute",
96: "96ChannelWasteChute",
}[num_channels]

self._engine_client.move_to_addressable_area(
pipette_id=self._pipette_id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Deck configuration resource provider."""
from typing import List, Set, Tuple, Optional
from typing import List, Set, Tuple

from opentrons_shared_data.deck.dev_types import DeckDefinitionV4, CutoutFixture

from opentrons.types import Point, DeckSlotName
from opentrons.types import DeckSlotName

from ..types import (
AddressableArea,
Expand Down Expand Up @@ -106,27 +106,6 @@ def get_addressable_area_from_name(
y=addressable_area["boundingBox"]["yDimension"],
z=addressable_area["boundingBox"]["zDimension"],
)
drop_tips_deck_offset = addressable_area.get("dropTipsOffset")
drop_tip_location: Optional[Point]
if drop_tips_deck_offset:
drop_tip_location = Point(
x=drop_tips_deck_offset[0] + cutout_position.x,
y=drop_tips_deck_offset[1] + cutout_position.y,
z=drop_tips_deck_offset[2] + cutout_position.z,
)
else:
drop_tip_location = None

drop_labware_deck_offset = addressable_area.get("dropLabwareOffset")
drop_labware_location: Optional[Point]
if drop_labware_deck_offset:
drop_labware_location = Point(
x=drop_labware_deck_offset[0] + cutout_position.x,
y=drop_labware_deck_offset[1] + cutout_position.y,
z=drop_labware_deck_offset[2] + cutout_position.z,
)
else:
drop_labware_location = None

return AddressableArea(
area_name=addressable_area["id"],
Expand All @@ -138,8 +117,6 @@ def get_addressable_area_from_name(
compatible_module_types=addressable_area.get(
"compatibleModuleTypes", []
),
drop_tip_location=drop_tip_location,
drop_labware_location=drop_labware_location,
)
raise AddressableAreaDoesNotExistError(
f"Could not find addressable area with name {addressable_area_name}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
def is_waste_chute(addressable_area_name: str) -> bool:
"""Check if an addressable area is a Waste Chute."""
return addressable_area_name in {
"1and8ChannelWasteChute",
"1ChannelWasteChute",
"8ChannelWasteChute",
"96ChannelWasteChute",
"gripperWasteChute",
}
Expand All @@ -19,7 +20,11 @@ def is_gripper_waste_chute(addressable_area_name: str) -> bool:

def is_drop_tip_waste_chute(addressable_area_name: str) -> bool:
"""Check if an addressable area is a Waste Chute compatible for dropping tips."""
return addressable_area_name in {"1and8ChannelWasteChute", "96ChannelWasteChute"}
return addressable_area_name in {
"1ChannelWasteChute",
"8ChannelWasteChute",
"96ChannelWasteChute",
}


def is_trash(addressable_area_name: str) -> bool:
Expand Down
11 changes: 4 additions & 7 deletions api/src/opentrons/protocol_engine/state/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,11 @@ def get_labware_grip_point(
elif isinstance(location, AddressableAreaLocation):
location_name = location.addressableAreaName
if fixture_validation.is_gripper_waste_chute(location_name):
gripper_waste_chute = self._addressable_areas.get_addressable_area(
location_name
)
drop_labware_location = gripper_waste_chute.drop_labware_location
if drop_labware_location is None:
raise ValueError(
f"{location_name} does not have a drop labware location associated with it"
drop_labware_location = (
self._addressable_areas.get_addressable_area_move_to_location(
location_name
)
)
return drop_labware_location + Point(z=grip_height_from_labware_bottom)
# Location should have been pre-validated so this will be a deck/staging area slot
else:
Expand Down
4 changes: 1 addition & 3 deletions api/src/opentrons/protocol_engine/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing_extensions import Literal, TypeGuard

from opentrons_shared_data.pipette.dev_types import PipetteNameType
from opentrons.types import MountType, DeckSlotName, Point
from opentrons.types import MountType, DeckSlotName
from opentrons.hardware_control.types import TipStateType as HwTipStateType
from opentrons.hardware_control.modules import (
ModuleType as ModuleType,
Expand Down Expand Up @@ -705,8 +705,6 @@ class AddressableArea:
bounding_box: Dimensions
position: AddressableOffsetVector
compatible_module_types: List[SharedDataModuleType]
drop_tip_location: Optional[Point]
drop_labware_location: Optional[Point]


class PostRunHardwareState(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from opentrons_shared_data.deck import load as load_deck
from opentrons_shared_data.deck.dev_types import DeckDefinitionV4

from opentrons.types import Point, DeckSlotName
from opentrons.types import DeckSlotName

from opentrons.protocol_engine.errors import (
FixtureDoesNotExistError,
Expand Down Expand Up @@ -259,8 +259,6 @@ def test_get_potential_cutout_fixtures_raises(
"temperatureModuleType",
"heaterShakerModuleType",
],
drop_tip_location=None,
drop_labware_location=None,
),
lazy_fixture("ot2_standard_deck_def"),
),
Expand All @@ -278,8 +276,6 @@ def test_get_potential_cutout_fixtures_raises(
"temperatureModuleType",
"heaterShakerModuleType",
],
drop_tip_location=None,
drop_labware_location=None,
),
lazy_fixture("ot2_short_trash_deck_def"),
),
Expand All @@ -297,8 +293,6 @@ def test_get_potential_cutout_fixtures_raises(
"heaterShakerModuleType",
"magneticBlockType",
],
drop_tip_location=None,
drop_labware_location=None,
),
lazy_fixture("ot3_standard_deck_def"),
),
Expand All @@ -312,8 +306,6 @@ def test_get_potential_cutout_fixtures_raises(
bounding_box=Dimensions(x=246.5, y=91.5, z=40),
position=AddressableOffsetVector(x=-16, y=-0.75, z=3),
compatible_module_types=[],
drop_tip_location=Point(x=124.25, y=47.75, z=43.0),
drop_labware_location=None,
),
lazy_fixture("ot3_standard_deck_def"),
),
Expand All @@ -324,11 +316,9 @@ def test_get_potential_cutout_fixtures_raises(
area_type=AreaType.WASTE_CHUTE,
base_slot=DeckSlotName.SLOT_A1,
display_name="Gripper Waste Chute",
bounding_box=Dimensions(x=155.0, y=86.0, z=125.0),
position=AddressableOffsetVector(x=-12.5, y=2, z=3),
bounding_box=Dimensions(x=0, y=0, z=0),
position=AddressableOffsetVector(x=65, y=31, z=139.5),
compatible_module_types=[],
drop_tip_location=None,
drop_labware_location=Point(x=65, y=31, z=139.5),
),
lazy_fixture("ot3_standard_deck_def"),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def test_initial_state(
assert not subject.state.use_simulated_deck_config
assert subject.state.deck_definition == ot3_standard_deck_def
assert subject.state.deck_configuration == _make_deck_config()
# Loading 9 regular slots, 1 trash, 2 Staging Area slots and 3 waste chute types
assert len(subject.state.loaded_addressable_areas_by_name) == 15
# Loading 9 regular slots, 1 trash, 2 Staging Area slots and 4 waste chute types
assert len(subject.state.loaded_addressable_areas_by_name) == 16


@pytest.mark.parametrize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ def test_get_loaded_addressable_area() -> None:
bounding_box=Dimensions(x=1, y=2, z=3),
position=AddressableOffsetVector(x=7, y=8, z=9),
compatible_module_types=["magneticModuleType"],
drop_tip_location=Point(11, 22, 33),
drop_labware_location=None,
)
subject = get_addressable_area_view(
loaded_addressable_areas_by_name={"abc": addressable_area}
Expand All @@ -128,8 +126,6 @@ def test_get_addressable_area_for_simulation_already_loaded() -> None:
bounding_box=Dimensions(x=1, y=2, z=3),
position=AddressableOffsetVector(x=7, y=8, z=9),
compatible_module_types=["magneticModuleType"],
drop_tip_location=Point(11, 22, 33),
drop_labware_location=None,
)
subject = get_addressable_area_view(
loaded_addressable_areas_by_name={"abc": addressable_area},
Expand Down Expand Up @@ -162,8 +158,6 @@ def test_get_addressable_area_for_simulation_not_loaded(decoy: Decoy) -> None:
bounding_box=Dimensions(x=1, y=2, z=3),
position=AddressableOffsetVector(x=7, y=8, z=9),
compatible_module_types=["magneticModuleType"],
drop_tip_location=Point(11, 22, 33),
drop_labware_location=None,
)

decoy.when(
Expand Down Expand Up @@ -255,8 +249,6 @@ def test_get_addressable_area_position() -> None:
bounding_box=Dimensions(x=10, y=20, z=30),
position=AddressableOffsetVector(x=1, y=2, z=3),
compatible_module_types=[],
drop_tip_location=None,
drop_labware_location=None,
)
}
)
Expand All @@ -277,8 +269,6 @@ def test_get_addressable_area_move_to_location() -> None:
bounding_box=Dimensions(x=10, y=20, z=30),
position=AddressableOffsetVector(x=1, y=2, z=3),
compatible_module_types=[],
drop_tip_location=None,
drop_labware_location=None,
)
}
)
Expand All @@ -299,8 +289,6 @@ def test_get_addressable_area_center() -> None:
bounding_box=Dimensions(x=10, y=20, z=30),
position=AddressableOffsetVector(x=1, y=2, z=3),
compatible_module_types=[],
drop_tip_location=None,
drop_labware_location=None,
)
}
)
Expand Down Expand Up @@ -358,8 +346,6 @@ def test_get_slot_definition() -> None:
bounding_box=Dimensions(x=1, y=2, z=3),
position=AddressableOffsetVector(x=7, y=8, z=9),
compatible_module_types=["magneticModuleType"],
drop_tip_location=None,
drop_labware_location=None,
)
}
)
Expand Down
11 changes: 5 additions & 6 deletions shared-data/deck/definitions/4/ot2_short_trash.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,14 @@
{
"id": "shortFixedTrash",
"areaType": "fixedTrash",
"offsetFromCutoutFixture": [0.0, 0.0, 0.0],
"offsetFromCutoutFixture": [82.84, 80.0, 58],
"boundingBox": {
"xDimension": 172.86,
"yDimension": 165.86,
"zDimension": 58
"xDimension": 0,
"yDimension": 0,
"zDimension": 0
},
"displayName": "Slot 12/Short Fixed Trash",
"ableToDropTips": true,
"dropTipsOffset": [82.84, 80.0, 58]
"ableToDropTips": true
}
],
"cutouts": [
Expand Down
11 changes: 5 additions & 6 deletions shared-data/deck/definitions/4/ot2_standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,14 @@
{
"id": "fixedTrash",
"areaType": "fixedTrash",
"offsetFromCutoutFixture": [0.0, 0.0, 0.0],
"offsetFromCutoutFixture": [82.84, 80, 82],
"boundingBox": {
"xDimension": 172.86,
"yDimension": 165.86,
"zDimension": 82
"xDimension": 0,
"yDimension": 0,
"zDimension": 0
},
"displayName": "Slot 12/Fixed Trash",
"ableToDropTips": true,
"dropTipsOffset": [82.84, 80.0, 82.0]
"ableToDropTips": true
}
],
"cutouts": [
Expand Down
Loading
Loading