Skip to content

Commit

Permalink
Rename AddressableArea -> AddressableAreaV4
Browse files Browse the repository at this point in the history
This has a matingSurfaceUnitVector field, which does not exist in schema 6. Rename the type so it doesn't look more generally usable than it actually is.
  • Loading branch information
SyntaxColoring committed Jan 30, 2025
1 parent fb5eb31 commit ec51ac0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions shared-data/python/opentrons_shared_data/deck/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class _RequiredAddressableArea(TypedDict):
displayName: str


class AddressableArea(_RequiredAddressableArea, total=False):
class AddressableAreaV4(_RequiredAddressableArea, total=False):
compatibleModuleTypes: List[ModuleType]
matingSurfaceUnitVector: List[Union[Literal[1], Literal[-1]]]
ableToDropTips: bool
Expand Down Expand Up @@ -150,7 +150,7 @@ class LocationsV3(TypedDict):


class LocationsV4(TypedDict):
addressableAreas: List[AddressableArea]
addressableAreas: List[AddressableAreaV4]
calibrationPoints: List[CalibrationPoint]
cutouts: List[Cutout]
legacyFixtures: List[Fixture]
Expand Down
8 changes: 4 additions & 4 deletions shared-data/python/tests/deck/test_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
load as load_deck_definition,
)
from opentrons_shared_data.deck.types import (
AddressableArea,
AddressableAreaV4,
Cutout,
CutoutFixture,
DeckDefinitionV3,
Expand All @@ -33,13 +33,13 @@ def get_v3_slot_positions(

def get_v4_stacks(
definition: DeckDefinitionV4,
) -> Generator[Tuple[Cutout, CutoutFixture, AddressableArea], None, None]:
) -> Generator[Tuple[Cutout, CutoutFixture, AddressableAreaV4], None, None]:
"""Yield all the (cutout, cutoutFixture, addressableArea) combinations that the def allows."""
cutout_fixtures = definition["cutoutFixtures"]
cutouts_by_id: Dict[str, Cutout] = {
cutout["id"]: cutout for cutout in definition["locations"]["cutouts"]
}
addressable_areas_by_id: Dict[str, AddressableArea] = {
addressable_areas_by_id: Dict[str, AddressableAreaV4] = {
addressable_area["id"]: addressable_area
for addressable_area in definition["locations"]["addressableAreas"]
}
Expand All @@ -55,7 +55,7 @@ def get_v4_stacks(


def compute_v4_position(
cutout: Cutout, addressable_area: AddressableArea
cutout: Cutout, addressable_area: AddressableAreaV4
) -> List[float]:
return [
a + b
Expand Down

0 comments on commit ec51ac0

Please sign in to comment.