Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(shared-data): Pre-sort innerLabwareGeometry sections #17426

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions shared-data/js/__tests__/labwareDefSchemaV3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ const checkGeometryDefinitions = (
labwareDef: LabwareDefinition3,
filename: string
): void => {
test('innerLabwareGeometry sections should be sorted top to bottom', () => {
const geometries = Object.values(labwareDef.innerLabwareGeometry ?? [])
for (const geometry of geometries) {
const sectionList = geometry.sections
const sortedSectionList = sectionList.toSorted(
(a, b) => b.topHeight - a.topHeight
)
expect(sortedSectionList).toStrictEqual(sectionList)
}
})

test(`all geometryDefinitionIds specified in {filename} should have an accompanying valid entry in innerLabwareGeometry`, () => {
for (const wellName in labwareDef.wells) {
const wellGeometryId = labwareDef.wells[wellName].geometryDefinitionId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
"innerLabwareGeometry": {
"cuboidalWell": {
"sections": [
{
"shape": "cuboidal",
"topXDimension": 107.5,
"topYDimension": 71.25,
"bottomXDimension": 106.79,
"bottomYDimension": 71.0,
"topHeight": 39.23,
"bottomHeight": 2.0
},
{
"shape": "cuboidal",
"topXDimension": 106.79,
Expand All @@ -64,15 +73,6 @@
"topHeight": 2,
"bottomHeight": 0,
"yCount": 8
},
{
"shape": "cuboidal",
"topXDimension": 107.5,
"topYDimension": 71.25,
"bottomXDimension": 106.79,
"bottomYDimension": 71.0,
"topHeight": 39.23,
"bottomHeight": 2.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4705,10 +4705,11 @@
"conicalWell": {
"sections": [
{
"shape": "spherical",
"radiusOfCurvature": 0.89,
"topHeight": 0.34,
"bottomHeight": 0.0
"shape": "conical",
"bottomDiameter": 3.17,
"topDiameter": 3.17,
"topHeight": 9.09,
"bottomHeight": 5.77
},
{
"shape": "conical",
Expand All @@ -4718,11 +4719,10 @@
"bottomHeight": 0.34
},
{
"shape": "conical",
"bottomDiameter": 3.17,
"topDiameter": 3.17,
"topHeight": 9.09,
"bottomHeight": 5.77
"shape": "spherical",
"radiusOfCurvature": 0.89,
"topHeight": 0.34,
"bottomHeight": 0.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,10 +1142,11 @@
"conicalWell": {
"sections": [
{
"shape": "spherical",
"radiusOfCurvature": 1.25,
"topHeight": 0.8,
"bottomHeight": 0.0
"shape": "conical",
"bottomDiameter": 5.5,
"topDiameter": 5.5,
"topHeight": 14.95,
"bottomHeight": 11.35
},
{
"shape": "conical",
Expand All @@ -1155,11 +1156,10 @@
"bottomHeight": 0.8
},
{
"shape": "conical",
"bottomDiameter": 5.5,
"topDiameter": 5.5,
"topHeight": 14.95,
"bottomHeight": 11.35
"shape": "spherical",
"radiusOfCurvature": 1.25,
"topHeight": 0.8,
"bottomHeight": 0.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4716,10 +4716,11 @@
"conicalWell": {
"sections": [
{
"shape": "spherical",
"radiusOfCurvature": 0.94,
"topHeight": 0.35,
"bottomHeight": 0.0
"shape": "conical",
"bottomDiameter": 3,
"topDiameter": 3.1,
"topHeight": 9.35,
"bottomHeight": 5.35
},
{
"shape": "conical",
Expand All @@ -4729,11 +4730,10 @@
"bottomHeight": 0.35
},
{
"shape": "conical",
"bottomDiameter": 3,
"topDiameter": 3.1,
"topHeight": 9.35,
"bottomHeight": 5.35
"shape": "spherical",
"radiusOfCurvature": 0.94,
"topHeight": 0.35,
"bottomHeight": 0.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1143,17 +1143,18 @@
"conicalWell": {
"sections": [
{
"shape": "spherical",
"radiusOfCurvature": 1.42,
"topHeight": 1.21,
"bottomHeight": 0.0
"shape": "conical",
"bottomDiameter": 5.44,
"topDiameter": 5.44,
"topHeight": 14.57,
"bottomHeight": 10.14
},
{
"shape": "conical",
"topDiameter": 3.0,
"bottomDiameter": 2.81,
"topHeight": 1.87,
"bottomHeight": 1.21
"topDiameter": 5.44,
"bottomDiameter": 4.98,
"topHeight": 10.14,
"bottomHeight": 8.58
},
{
"shape": "conical",
Expand All @@ -1164,17 +1165,16 @@
},
{
"shape": "conical",
"topDiameter": 5.44,
"bottomDiameter": 4.98,
"topHeight": 10.14,
"bottomHeight": 8.58
"topDiameter": 3.0,
"bottomDiameter": 2.81,
"topHeight": 1.87,
"bottomHeight": 1.21
},
{
"shape": "conical",
"bottomDiameter": 5.44,
"topDiameter": 5.44,
"topHeight": 14.57,
"bottomHeight": 10.14
"shape": "spherical",
"radiusOfCurvature": 1.42,
"topHeight": 1.21,
"bottomHeight": 0.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,6 @@
"innerLabwareGeometry": {
"cuboidalWell": {
"sections": [
{
"shape": "cuboidal",
"topXDimension": 7.95,
"topYDimension": 70.53,
"bottomXDimension": 1.87,
"bottomYDimension": 64.45,
"topHeight": 2.05,
"bottomHeight": 0.0
},
{
"shape": "cuboidal",
"topXDimension": 8.35,
Expand All @@ -219,6 +210,15 @@
"bottomYDimension": 70.53,
"topHeight": 26.85,
"bottomHeight": 2.05
},
{
"shape": "cuboidal",
"topXDimension": 7.95,
"topYDimension": 70.53,
"bottomXDimension": 1.87,
"bottomYDimension": 64.45,
"topHeight": 2.05,
"bottomHeight": 0.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
"innerLabwareGeometry": {
"cuboidalWell": {
"sections": [
{
"shape": "cuboidal",
"topXDimension": 71.3,
"topYDimension": 107.3,
"bottomXDimension": 70.6,
"bottomYDimension": 106.8,
"topHeight": 26.85,
"bottomHeight": 2.0
},
{
"shape": "cuboidal",
"topXDimension": 9,
Expand All @@ -67,15 +76,6 @@
"bottomHeight": 0,
"xCount": 12,
"yCount": 8
},
{
"shape": "cuboidal",
"topXDimension": 71.3,
"topYDimension": 107.3,
"bottomXDimension": 70.6,
"bottomYDimension": 106.8,
"topHeight": 26.85,
"bottomHeight": 2.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
"innerLabwareGeometry": {
"cuboidalWell": {
"sections": [
{
"shape": "cuboidal",
"topXDimension": 107.76,
"topYDimension": 71.0,
"bottomXDimension": 106.75,
"bottomYDimension": 70.75,
"topHeight": 39.55,
"bottomHeight": 2.0
},
{
"shape": "cuboidal",
"topXDimension": 7.75,
Expand All @@ -64,15 +73,6 @@
"topHeight": 2.0,
"bottomHeight": 0.0,
"xCount": 12
},
{
"shape": "cuboidal",
"topXDimension": 107.76,
"topYDimension": 71.0,
"bottomXDimension": 106.75,
"bottomYDimension": 70.75,
"topHeight": 39.55,
"bottomHeight": 2.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,10 +1136,11 @@
"conicalWell": {
"sections": [
{
"shape": "spherical",
"radiusOfCurvature": 3.015,
"topHeight": 0.2,
"bottomHeight": 0.0
"shape": "conical",
"bottomDiameter": 5.26,
"topDiameter": 5.34,
"topHeight": 14.7,
"bottomHeight": 9.89
},
{
"shape": "conical",
Expand All @@ -1149,11 +1150,10 @@
"bottomHeight": 0.2
},
{
"shape": "conical",
"bottomDiameter": 5.26,
"topDiameter": 5.34,
"topHeight": 14.7,
"bottomHeight": 9.89
"shape": "spherical",
"radiusOfCurvature": 3.015,
"topHeight": 0.2,
"bottomHeight": 0.0
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1238,15 +1238,6 @@
"innerLabwareGeometry": {
"cuboidalWell": {
"sections": [
{
"shape": "cuboidal",
"topXDimension": 7.4,
"topYDimension": 7.4,
"bottomXDimension": 2.63,
"bottomYDimension": 2.63,
"topHeight": 1.67,
"bottomHeight": 0.0
},
{
"shape": "cuboidal",
"topXDimension": 8.2,
Expand All @@ -1255,6 +1246,15 @@
"bottomYDimension": 7.4,
"topHeight": 38.05,
"bottomHeight": 1.67
},
{
"shape": "cuboidal",
"topXDimension": 7.4,
"topYDimension": 7.4,
"bottomXDimension": 2.63,
"bottomYDimension": 2.63,
"topHeight": 1.67,
"bottomHeight": 0.0
}
]
}
Expand Down
Loading
Loading