Skip to content

Commit

Permalink
Fixes to lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyBatten committed Oct 24, 2023
1 parent 7fdfacb commit cb592b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
23 changes: 12 additions & 11 deletions api/src/opentrons/protocol_engine/resources/fixture_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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


Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from enum import Enum
from typing import Dict, List, Optional

Check warning on line 9 in shared-data/python/opentrons_shared_data/deck/deck_definitions.py

View check run for this annotation

Codecov / codecov/patch

shared-data/python/opentrons_shared_data/deck/deck_definitions.py#L8-L9

Added lines #L8 - L9 were not covered by tests

from pydantic import BaseModel, Extra, Field, confloat
from pydantic import BaseModel, Extra, Field, PositiveFloat

Check warning on line 11 in shared-data/python/opentrons_shared_data/deck/deck_definitions.py

View check run for this annotation

Codecov / codecov/patch

shared-data/python/opentrons_shared_data/deck/deck_definitions.py#L11

Added line #L11 was not covered by tests


class SchemaVersion(Enum):
Expand Down Expand Up @@ -55,7 +55,7 @@ class CutoutFixture(BaseModel):


class PositiveNumber(BaseModel):
__root__: confloat(ge=0.0)
__root__: PositiveFloat

Check warning on line 58 in shared-data/python/opentrons_shared_data/deck/deck_definitions.py

View check run for this annotation

Codecov / codecov/patch

shared-data/python/opentrons_shared_data/deck/deck_definitions.py#L57-L58

Added lines #L57 - L58 were not covered by tests


class XyzArray(BaseModel):
Expand Down Expand Up @@ -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(

Check warning on line 170 in shared-data/python/opentrons_shared_data/deck/deck_definitions.py

View check run for this annotation

Codecov / codecov/patch

shared-data/python/opentrons_shared_data/deck/deck_definitions.py#L169-L170

Added lines #L169 - L170 were not covered by tests
Expand Down

0 comments on commit cb592b0

Please sign in to comment.