Skip to content

Commit

Permalink
remaining AA defs and module fixture updates
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyBatten committed Mar 18, 2024
1 parent ecccea0 commit 7f110f6
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 73 deletions.
25 changes: 10 additions & 15 deletions api/src/opentrons/protocol_api/core/engine/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
from typing import Dict, Optional, Type, Union, List, Tuple, TYPE_CHECKING

from opentrons.protocol_engine.commands import LoadModuleResult
from opentrons_shared_data.deck.dev_types import (
DeckDefinitionV5,
SlotDefV3,
CutoutFixture,
)
from opentrons_shared_data.deck.dev_types import DeckDefinitionV5, SlotDefV3
from opentrons.protocol_engine.resources import deck_configuration_provider
from opentrons_shared_data.labware.labware_definition import LabwareDefinition
from opentrons_shared_data.labware.dev_types import LabwareDefinition as LabwareDefDict
from opentrons_shared_data.pipette.dev_types import PipetteNameType
Expand Down Expand Up @@ -638,16 +635,14 @@ def _ensure_module_location(
)
else:
cutout_fixture_id = ModuleType.to_module_fixture_id(module_type)
potential_fixtures_in_slot = self._engine_client.state.addressable_areas._state.potential_cutout_fixtures_by_cutout_id[
self._engine_client.state.addressable_areas.get_cutout_id_by_deck_slot_name(
slot
)
]
module_fixture_found = False
for fixture in potential_fixtures_in_slot:
if fixture.cutout_fixture_id == cutout_fixture_id:
module_fixture_found = True
if not module_fixture_found:
module_fixture = deck_configuration_provider.get_cutout_fixture(
cutout_fixture_id,
self._engine_client.state.addressable_areas.state.deck_definition,
)
cutout_id = self._engine_client.state.addressable_areas.get_cutout_id_by_deck_slot_name(
slot
)
if cutout_id not in module_fixture["mayMountTo"]:
raise ValueError(
f"A {module_type.value} cannot be loaded into slot {slot}"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ def get_provided_addressable_area_names(
try:
return cutout_fixture["providesAddressableAreas"][cutout_id]
except KeyError as exception:
raise FixtureDoesNotProvideAreasError(
f"Cutout fixture {cutout_fixture['id']} does not provide addressable areas for {cutout_id}"
) from exception
# raise FixtureDoesNotProvideAreasError(
# f"Cutout fixture {cutout_fixture['id']} does not provide addressable areas for {cutout_id}"
# ) from exception
return []


def get_addressable_area_display_name(
Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_engine/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@ class AreaType(Enum):
TEMPERATURE = "temperatureModule"



@dataclass(frozen=True)
class AddressableArea:
"""Addressable area that has been loaded."""
Expand Down
Loading

0 comments on commit 7f110f6

Please sign in to comment.