Skip to content

Commit

Permalink
My symantics knows no bounds other than two parallel 4 sided polygons.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Oct 7, 2024
1 parent 7eec633 commit 2aa5b9b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 44 deletions.
8 changes: 4 additions & 4 deletions api/src/opentrons/protocol_engine/state/frustum_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
WellSegment,
SphericalSegment,
ConicalFrustum,
PyramidalFrustum,
CuboidalFrustum,
)


Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions api/tests/opentrons/protocol_runner/test_json_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Group,
Metadata1,
WellDefinition,
PyramidalFrustum,
CuboidalFrustum,
InnerWellGeometry,
SphericalSegment,
)
Expand Down Expand Up @@ -691,17 +691,17 @@ 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,
bottomYDimension=6.5,
topHeight=45,
bottomHeight=20,
),
PyramidalFrustum(
shape="pyramidal",
CuboidalFrustum(
shape="cuboidal",
topXDimension=5.6,
topYDimension=6.5,
bottomXDimension=4.5,
Expand Down
24 changes: 12 additions & 12 deletions api/tests/opentrons/protocols/geometry/test_frustum_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from opentrons_shared_data.labware.labware_definition import (
ConicalFrustum,
PyramidalFrustum,
CuboidalFrustum,
SphericalSegment,
)
from opentrons.protocol_engine.state.frustum_helpers import (
Expand All @@ -30,17 +30,17 @@ def fake_frusta() -> List[List[Any]]:
frusta = []
frusta.append(
[
PyramidalFrustum(
shape="pyramidal",
CuboidalFrustum(
shape="cuboidal",
topXDimension=9.0,
topYDimension=10.0,
bottomXDimension=8.0,
bottomYDimension=9.0,
topHeight=10.0,
bottomHeight=5.0,
),
PyramidalFrustum(
shape="pyramidal",
CuboidalFrustum(
shape="cuboidal",
topXDimension=8.0,
topYDimension=9.0,
bottomXDimension=15.0,
Expand All @@ -65,17 +65,17 @@ def fake_frusta() -> List[List[Any]]:
)
frusta.append(
[
PyramidalFrustum(
shape="pyramidal",
CuboidalFrustum(
shape="cuboidal",
topXDimension=8.0,
topYDimension=70.0,
bottomXDimension=7.0,
bottomYDimension=75.0,
topHeight=3.5,
bottomHeight=2.0,
),
PyramidalFrustum(
shape="pyramidal",
CuboidalFrustum(
shape="cuboidal",
topXDimension=8.0,
topYDimension=80.0,
bottomXDimension=8.0,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions shared-data/labware/schemas/3.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -130,7 +130,7 @@
"properties": {
"shape": {
"type": "string",
"enum": ["pyramidal"]
"enum": ["cuboidal"]
},
"bottomXDimension": {
"type": "number"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions shared-data/python/opentrons_shared_data/labware/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

from .constants import (
Conical,
Pyramidal,
RoundedPyramid,
Cuboidal,
RoundedCuboid,
SquaredCone,
Spherical,
WellShape,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 = [
Expand All @@ -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 ]];
Expand Down Expand Up @@ -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(
...,
Expand Down Expand Up @@ -490,9 +490,9 @@ class Group(BaseModel):

WellSegment = Union[
ConicalFrustum,
PyramidalFrustum,
CuboidalFrustum,
SquaredConeSegment,
RoundedPyramidSegment,
RoundedCuboidSegment,
SphericalSegment,
]

Expand Down

0 comments on commit 2aa5b9b

Please sign in to comment.