From 8fde331edd53d2432bee31591b401d5219f803f6 Mon Sep 17 00:00:00 2001 From: caila-marashaj Date: Wed, 14 Aug 2024 15:50:09 -0400 Subject: [PATCH] change hemisphere to spherical segment --- .../protocol_runner/test_json_translator.py | 8 ++++---- .../labware/labware_definition.py | 16 +++++++--------- .../opentrons_shared_data/labware/types.py | 11 ++++++----- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/api/tests/opentrons/protocol_runner/test_json_translator.py b/api/tests/opentrons/protocol_runner/test_json_translator.py index 8bec47b3080..6dbba6a006c 100644 --- a/api/tests/opentrons/protocol_runner/test_json_translator.py +++ b/api/tests/opentrons/protocol_runner/test_json_translator.py @@ -16,7 +16,7 @@ BoundedSection, RectangularCrossSection, InnerLabwareGeometry, - Hemisphere, + SphericalSegment, ) from opentrons_shared_data.protocol.models import ( protocol_schema_v6, @@ -708,9 +708,9 @@ def _load_labware_definition_data() -> LabwareDefinition: topHeight=20, ), ], - bottomShape=Hemisphere( - shape="hemispherical", - diameter=6, + bottomShape=SphericalSegment( + shape="spherical", + radius_of_curvature=6, depth=10, ), ), diff --git a/shared-data/python/opentrons_shared_data/labware/labware_definition.py b/shared-data/python/opentrons_shared_data/labware/labware_definition.py index f2e231c8afe..537ea89ee27 100644 --- a/shared-data/python/opentrons_shared_data/labware/labware_definition.py +++ b/shared-data/python/opentrons_shared_data/labware/labware_definition.py @@ -245,21 +245,19 @@ class RectangularCrossSection(BaseModel): ) -class Hemisphere(BaseModel): - shape: Literal["hemispherical"] = Field( - ..., description="Denote shape as hemispherical" - ) - diameter: _NonNegativeNumber = Field( +class SphericalSegment(BaseModel): + shape: Literal["spherical"] = Field(..., description="Denote shape as spherical") + radius_of_curvature: _NonNegativeNumber = Field( ..., - description="diameter of bottom subsection of wells", + description="radius of curvature of bottom subsection of wells", ) depth: _NonNegativeNumber = Field( - ..., description="The depth of a hemispherical bottom of a well" + ..., description="The depth of a spherical bottom of a well" ) TopCrossSection = Union[CircularCrossSection, RectangularCrossSection] -BottomShape = Union[CircularCrossSection, RectangularCrossSection, Hemisphere] +BottomShape = Union[CircularCrossSection, RectangularCrossSection, SphericalSegment] class BoundedSection(BaseModel): @@ -310,7 +308,7 @@ class InnerLabwareGeometry(BaseModel): ) bottomShape: BottomShape = Field( ..., - description="The shape at the bottom of the well: either a hemisphere or a cross-section", + description="The shape at the bottom of the well: either a spherical segment or a cross-section", discriminator="shape", ) diff --git a/shared-data/python/opentrons_shared_data/labware/types.py b/shared-data/python/opentrons_shared_data/labware/types.py index 197d7460c58..c92c9d04dec 100644 --- a/shared-data/python/opentrons_shared_data/labware/types.py +++ b/shared-data/python/opentrons_shared_data/labware/types.py @@ -37,7 +37,7 @@ Circular = Literal["circular"] Rectangular = Literal["rectangular"] -Hemispherical = Literal["hemispherical"] +Spherical = Literal["spherical"] WellShape = Union[Circular, Rectangular] @@ -129,13 +129,14 @@ class RectangularCrossSection(TypedDict): yDimension: float -class Hemisphere(TypedDict): - shape: Hemispherical - diameter: float +class SphericalSegment(TypedDict): + shape: Spherical + radius_of_curvature: float + depth: float TopCrossSection = Union[CircularCrossSection, RectangularCrossSection] -BottomShape = Union[CircularCrossSection, RectangularCrossSection, Hemispherical] +BottomShape = Union[CircularCrossSection, RectangularCrossSection, Spherical] class BoundedSection(TypedDict):