Skip to content

Commit

Permalink
handle some typing more clearly
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Oct 21, 2024
1 parent 9df2de1 commit 0e80c8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions shared-data/python/opentrons_shared_data/labware/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
WELL_NAME_PATTERN: Final["re.Pattern[str]"] = re.compile(r"^([A-Z]+)([0-9]+)$", re.X)

# These shapes are for wellshape definitions and describe the top of the well
Circular: Literal["circular"] = "circular"
Rectangular: Literal["rectangular"] = "rectangular"
CircularType = Literal["circular"]
Circular: CircularType = "circular"
RectangularType = Literal["rectangular"]
Rectangular: RectangularType = "rectangular"
WellShape = Union[Literal["circular"], Literal["rectangular"]]

# These shapes are used to describe the 3D primatives used to build wells
Expand Down
8 changes: 4 additions & 4 deletions shared-data/python/opentrons_shared_data/labware/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from typing_extensions import Literal, TypedDict, NotRequired
from .labware_definition import InnerWellGeometry
from .constants import (
Circular,
Rectangular,
CircularType,
RectangularType,
)

LabwareUri = NewType("LabwareUri", str)
Expand Down Expand Up @@ -83,7 +83,7 @@ class LabwareDimensions(TypedDict):


class CircularWellDefinition(TypedDict):
shape: Circular
shape: CircularType
depth: float
totalLiquidVolume: float
x: float
Expand All @@ -94,7 +94,7 @@ class CircularWellDefinition(TypedDict):


class RectangularWellDefinition(TypedDict):
shape: Rectangular
shape: RectangularType
depth: float
totalLiquidVolume: float
x: float
Expand Down

0 comments on commit 0e80c8a

Please sign in to comment.