Skip to content

Commit

Permalink
fix innerwellgeometry defs
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Aug 12, 2024
1 parent 77921e9 commit be381d6
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,33 +105,6 @@ class DisplayCategory(str, Enum):
other = "other"


class CircleArea(BaseModel):
radius: float


class RectangleArea(BaseModel):
length: float
width: float


class Hemisphere(BaseModel):
radius: float
depth: float


CrossSectionShape = Union[CircleArea, RectangleArea]


class CrossSection(BaseModel):
shape: CrossSectionShape
height: float


class InnerLabwareGeometry(BaseModel):
cross_sections: List[CrossSection]
hemisphere: Optional[Hemisphere]


class LabwareRole(str, Enum):
labware = "labware"
fixture = "fixture"
Expand Down Expand Up @@ -251,6 +224,41 @@ class Config:
)


class InnerGeometrySection(BaseModel):
shape: Literal["rectangular", "circular", "hemisphere"] = Field(
...,
description="Shape of a cross-section of a well used to determine how "
"to calculate area",
)
xDimension: Optional[_NonNegativeNumber] = Field(
None,
description="x dimension of rectangular wells",
)
yDimension: Optional[_NonNegativeNumber] = Field(
None,
description="y dimension of rectangular wells",
)
diameter: Optional[_NonNegativeNumber] = Field(
None,
description="diameter of circular wells",
)


class BoundedSection(BaseModel):
shape: InnerGeometrySection = Field(
...,
description="Geometrical layout of the geometry of a section of the inside of a well",
)
top_height: _NonNegativeNumber = Field(
...,
description="The height at the top of a bounded subsection of a well"
)


class InnerLabwareGeometry(BaseModel):
boundedSections: List[BoundedSection]


class Metadata1(BaseModel):
"""
Metadata specific to a grid of wells in a labware
Expand Down Expand Up @@ -353,3 +361,10 @@ class LabwareDefinition(BaseModel):
default_factory=None,
description="Force, in Newtons, with which the gripper should grip the labware.",
)
innerWellGeometry: Optional[InnerLabwareGeometry] = Field(
...,
description="A layout describing the geometry of the inside of the wells.",
)



29 changes: 29 additions & 0 deletions shared-data/python/opentrons_shared_data/labware/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

Circular = Literal["circular"]
Rectangular = Literal["rectangular"]
Hemisphere = Literal["hemisphere"]
WellShape = Union[Circular, Rectangular]


Expand Down Expand Up @@ -138,3 +139,31 @@ class LabwareDefinition(_RequiredLabwareDefinition, total=False):
gripperOffsets: Dict[str, GripperOffsets]
gripForce: float
gripHeightFromLabwareBottom: float


class CircularArea(TypedDict):
shape: Circular
diameter: float


class RectangularArea(TypedDict):
shape: Rectangular
xDimension: float
yDimension: float


class HemisphereDimensions(TypedDict):
shape: Hemisphere
diameter: float


InnerGeometrySection = Union[CircularArea, RectangularArea, HemisphereDimensions]


class BoundedSection(TypedDict):
shape: InnerGeometrySection
top_height: float


class InnerLabwareGeometry(TypedDict):
bounded_sections: List[BoundedSection]

0 comments on commit be381d6

Please sign in to comment.