diff --git a/api/src/opentrons/protocol_engine/resources/fixture_validation.py b/api/src/opentrons/protocol_engine/resources/fixture_validation.py index 59a62b3fa67..f459fca80f6 100644 --- a/api/src/opentrons/protocol_engine/resources/fixture_validation.py +++ b/api/src/opentrons/protocol_engine/resources/fixture_validation.py @@ -37,11 +37,12 @@ def validate_module_is_compatible_with_fixture( module_name = ModuleType.from_model(module).name for key in fixture.providesAddressableAreas.keys(): for area in fixture.providesAddressableAreas[key]: - addressableArea = locations.find_addressableArea(area) - if addressableArea.compatibleModuleTypes is None: - return False - elif module_name in addressableArea.compatibleModuleTypes: - return True + for l_area in locations.addressableAreas: + if l_area.id == area: + if l_area.compatibleModuleTypes is None: + return False + elif module_name in l_area.compatibleModuleTypes: + return True return False @@ -51,9 +52,9 @@ def validate_fixture_allows_drop_tip( """Validate that the fixture allows tips to be dropped in it's addressable areas.""" for key in fixture.providesAddressableAreas.keys(): for area in fixture.providesAddressableAreas[key]: - addressableArea = locations.find_addressableArea(area) - if addressableArea.ableToDropTips: - return True + for l_area in locations.addressableAreas: + if l_area.id == area and l_area.ableToDropTips: + return True return False @@ -63,7 +64,7 @@ def validate_fixture_allows_drop_labware( """Validate that the fixture allows labware to be dropped in it's addressable areas.""" for key in fixture.providesAddressableAreas.keys(): for area in fixture.providesAddressableAreas[key]: - addressableArea = locations.find_addressableArea(area) - if addressableArea.ableToDropLabware: - return True + for l_area in locations.addressableAreas: + if l_area.id == area and l_area.ableToDropLabware: + return True return False diff --git a/shared-data/python/opentrons_shared_data/deck/deck_definitions.py b/shared-data/python/opentrons_shared_data/deck/deck_definitions.py index 5d1038a422d..4e82e3f83de 100644 --- a/shared-data/python/opentrons_shared_data/deck/deck_definitions.py +++ b/shared-data/python/opentrons_shared_data/deck/deck_definitions.py @@ -8,7 +8,7 @@ from enum import Enum from typing import Dict, List, Optional -from pydantic import BaseModel, Extra, Field, confloat +from pydantic import BaseModel, Extra, Field, PositiveFloat class SchemaVersion(Enum): @@ -55,7 +55,7 @@ class CutoutFixture(BaseModel): class PositiveNumber(BaseModel): - __root__: confloat(ge=0.0) + __root__: PositiveFloat class XyzArray(BaseModel): @@ -165,13 +165,6 @@ class Locations(BaseModel): ..., description="The machined cutout slots on the deck surface." ) - @classmethod - def find_addressableArea(cls, id: str) -> AddressableArea: - for area in cls.addressableAreas: - if id == area.id: - return area - return None - class Default(BaseModel): pickUpOffset: Coordinates = Field(