From 2aa5b9bb58a4a809f8f311b13331e48fd5916175 Mon Sep 17 00:00:00 2001 From: Ryan howard Date: Mon, 7 Oct 2024 10:51:57 -0400 Subject: [PATCH] My symantics knows no bounds other than two parallel 4 sided polygons. --- .../protocol_engine/state/frustum_helpers.py | 8 +++--- .../protocol_runner/test_json_translator.py | 10 +++---- .../geometry/test_frustum_helpers.py | 24 ++++++++-------- shared-data/labware/schemas/3.json | 14 +++++----- .../labware/constants.py | 4 +-- .../labware/labware_definition.py | 28 +++++++++---------- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/api/src/opentrons/protocol_engine/state/frustum_helpers.py b/api/src/opentrons/protocol_engine/state/frustum_helpers.py index 7786b16384df..4f132ac3b40b 100644 --- a/api/src/opentrons/protocol_engine/state/frustum_helpers.py +++ b/api/src/opentrons/protocol_engine/state/frustum_helpers.py @@ -10,7 +10,7 @@ WellSegment, SphericalSegment, ConicalFrustum, - PyramidalFrustum, + CuboidalFrustum, ) @@ -204,7 +204,7 @@ def _get_segment_capacity(segment: WellSegment) -> float: target_height=segment.topHeight, radius_of_curvature=segment.radiusOfCurvature, ) - case PyramidalFrustum(): + case CuboidalFrustum(): section_height = segment.topHeight - segment.bottomHeight return _volume_from_height_rectangular( target_height=section_height, @@ -266,7 +266,7 @@ def height_at_volume_within_section( bottom_radius=(section.topDiameter / 2), total_frustum_height=section_height, ) - case PyramidalFrustum(): + case CuboidalFrustum(): return _height_from_volume_rectangular( volume=target_volume_relative, total_frustum_height=section_height, @@ -300,7 +300,7 @@ def volume_at_height_within_section( bottom_radius=(section.bottomDiameter / 2), top_radius=(section.topDiameter / 2), ) - case PyramidalFrustum(): + case CuboidalFrustum(): return _volume_from_height_rectangular( target_height=target_height_relative, total_frustum_height=section_height, diff --git a/api/tests/opentrons/protocol_runner/test_json_translator.py b/api/tests/opentrons/protocol_runner/test_json_translator.py index 4fe366d45828..69edd3c1445b 100644 --- a/api/tests/opentrons/protocol_runner/test_json_translator.py +++ b/api/tests/opentrons/protocol_runner/test_json_translator.py @@ -13,7 +13,7 @@ Group, Metadata1, WellDefinition, - PyramidalFrustum, + CuboidalFrustum, InnerWellGeometry, SphericalSegment, ) @@ -691,8 +691,8 @@ def _load_labware_definition_data() -> LabwareDefinition: innerLabwareGeometry={ "welldefinition1111": InnerWellGeometry( sections=[ - PyramidalFrustum( - shape="pyramidal", + CuboidalFrustum( + shape="cuboidal", topXDimension=7.6, topYDimension=8.5, bottomXDimension=5.6, @@ -700,8 +700,8 @@ def _load_labware_definition_data() -> LabwareDefinition: topHeight=45, bottomHeight=20, ), - PyramidalFrustum( - shape="pyramidal", + CuboidalFrustum( + shape="cuboidal", topXDimension=5.6, topYDimension=6.5, bottomXDimension=4.5, diff --git a/api/tests/opentrons/protocols/geometry/test_frustum_helpers.py b/api/tests/opentrons/protocols/geometry/test_frustum_helpers.py index b6e6ad3ebb14..0b8d34295275 100644 --- a/api/tests/opentrons/protocols/geometry/test_frustum_helpers.py +++ b/api/tests/opentrons/protocols/geometry/test_frustum_helpers.py @@ -4,7 +4,7 @@ from opentrons_shared_data.labware.labware_definition import ( ConicalFrustum, - PyramidalFrustum, + CuboidalFrustum, SphericalSegment, ) from opentrons.protocol_engine.state.frustum_helpers import ( @@ -30,8 +30,8 @@ def fake_frusta() -> List[List[Any]]: frusta = [] frusta.append( [ - PyramidalFrustum( - shape="pyramidal", + CuboidalFrustum( + shape="cuboidal", topXDimension=9.0, topYDimension=10.0, bottomXDimension=8.0, @@ -39,8 +39,8 @@ def fake_frusta() -> List[List[Any]]: topHeight=10.0, bottomHeight=5.0, ), - PyramidalFrustum( - shape="pyramidal", + CuboidalFrustum( + shape="cuboidal", topXDimension=8.0, topYDimension=9.0, bottomXDimension=15.0, @@ -65,8 +65,8 @@ def fake_frusta() -> List[List[Any]]: ) frusta.append( [ - PyramidalFrustum( - shape="pyramidal", + CuboidalFrustum( + shape="cuboidal", topXDimension=8.0, topYDimension=70.0, bottomXDimension=7.0, @@ -74,8 +74,8 @@ def fake_frusta() -> List[List[Any]]: topHeight=3.5, bottomHeight=2.0, ), - PyramidalFrustum( - shape="pyramidal", + CuboidalFrustum( + shape="cuboidal", topXDimension=8.0, topYDimension=80.0, bottomXDimension=8.0, @@ -139,8 +139,8 @@ def fake_frusta() -> List[List[Any]]: ) frusta.append( [ - PyramidalFrustum( - shape="pyramidal", + CuboidalFrustum( + shape="cuboidal", topXDimension=27.0, topYDimension=36.0, bottomXDimension=36.0, @@ -255,7 +255,7 @@ def test_volume_and_height_rectangular(well: List[Any]) -> None: return total_height = well[0].topHeight for segment in well: - if segment.shape == "pyramidal": + if segment.shape == "cuboidal": top_length = segment.topYDimension top_width = segment.topXDimension bottom_length = segment.bottomYDimension diff --git a/shared-data/labware/schemas/3.json b/shared-data/labware/schemas/3.json index 28999ca348ff..51db0e807468 100644 --- a/shared-data/labware/schemas/3.json +++ b/shared-data/labware/schemas/3.json @@ -115,9 +115,9 @@ } } }, - "PyramidalFrustum": { + "CuboidalFrustum": { "type": "object", - "description": "A pyramidal shape bounded by two rectangles on the top and bottom", + "description": "A cuboidal shape bounded by two rectangles on the top and bottom", "required": [ "shape", "bottomXDimension", @@ -130,7 +130,7 @@ "properties": { "shape": { "type": "string", - "enum": ["pyramidal"] + "enum": ["cuboidal"] }, "bottomXDimension": { "type": "number" @@ -190,9 +190,9 @@ } } }, - "RoundedPyramidSegment": { + "RoundedCuboidSegment": { "type": "object", - "description": "A pyramidal frustum where each corner is filleted out by circles with centers on the diagonals between opposite corners", + "description": "A cuboidal frustum where each corner is filleted out by circles with centers on the diagonals between opposite corners", "required": [ "shape", "bottomCrossSection", @@ -241,13 +241,13 @@ "$ref": "#/definitions/ConicalFrustum" }, { - "$ref": "#/definitions/PyramidalFrustum" + "$ref": "#/definitions/CuboidalFrustum" }, { "$ref": "#/definitions/SquaredConeSegment" }, { - "$ref": "#/definitions/RoundedPyramidSegment" + "$ref": "#/definitions/RoundedCuboidSegment" }, { "$ref": "#/definitions/SphericalSegment" diff --git a/shared-data/python/opentrons_shared_data/labware/constants.py b/shared-data/python/opentrons_shared_data/labware/constants.py index 3b12a88b8218..34955f37d7f9 100644 --- a/shared-data/python/opentrons_shared_data/labware/constants.py +++ b/shared-data/python/opentrons_shared_data/labware/constants.py @@ -14,7 +14,7 @@ # These shapes are used to describe the 3D primatives used to build wells Conical = Literal["conical"] -Pyramidal = Literal["pyramidal"] +Cuboidal = Literal["cuboidal"] SquaredCone = Literal["squaredcone"] -RoundedPyramid = Literal["roundedpyramid"] +RoundedCuboid = Literal["roundedpyramid"] Spherical = Literal["spherical"] 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 3e52d4d26cb2..a818afc106ad 100644 --- a/shared-data/python/opentrons_shared_data/labware/labware_definition.py +++ b/shared-data/python/opentrons_shared_data/labware/labware_definition.py @@ -21,8 +21,8 @@ from .constants import ( Conical, - Pyramidal, - RoundedPyramid, + Cuboidal, + RoundedCuboid, SquaredCone, Spherical, WellShape, @@ -271,8 +271,8 @@ class ConicalFrustum(BaseModel): ) -class PyramidalFrustum(BaseModel): - shape: Pyramidal = Field(..., description="Denote shape as pyramidal") +class CuboidalFrustum(BaseModel): + shape: Cuboidal = Field(..., description="Denote shape as cuboidal") bottomXDimension: _NonNegativeNumber = Field( ..., description="x dimension of the bottom cross-section of a rectangular frustum", @@ -350,7 +350,7 @@ class SquaredConeSegment(BaseModel): """ -module filitedPyramidSquare(bottom_shape, diameter, width, length, height, steps) { +module filitedCuboidSquare(bottom_shape, diameter, width, length, height, steps) { module _slice(depth, x, y, r) { echo("called with: ", depth, x, y, r); circle_centers = [ @@ -373,7 +373,7 @@ class SquaredConeSegment(BaseModel): } } } -module filitedPyramidForce(bottom_shape, diameter, width, length, height, steps) { +module filitedCuboidForce(bottom_shape, diameter, width, length, height, steps) { module single_cone(r,x,y,z) { r = diameter/2; circle_face = [[ for (i = [0:1: steps]) i ]]; @@ -419,19 +419,19 @@ class SquaredConeSegment(BaseModel): } } -module filitedPyramid(bottom_shape, diameter, width, length, height) { +module filitedCuboid(bottom_shape, diameter, width, length, height) { if (width == length && width == diameter) { - filitedPyramidSquare(bottom_shape, diameter, width, length, height, 100); + filitedCuboidSquare(bottom_shape, diameter, width, length, height, 100); } else { - filitedPyramidForce(bottom_shape, diameter, width, length, height, 100); + filitedCuboidForce(bottom_shape, diameter, width, length, height, 100); } }""" -class RoundedPyramidSegment(BaseModel): - shape: RoundedPyramid = Field( - ..., description="Denote shape as a rounded pyramidal segment" +class RoundedCuboidSegment(BaseModel): + shape: RoundedCuboid = Field( + ..., description="Denote shape as a rounded cuboidal segment" ) bottomCrossSection: WellShape = Field( ..., @@ -490,9 +490,9 @@ class Group(BaseModel): WellSegment = Union[ ConicalFrustum, - PyramidalFrustum, + CuboidalFrustum, SquaredConeSegment, - RoundedPyramidSegment, + RoundedCuboidSegment, SphericalSegment, ]