Skip to content

Commit dc7d164

Browse files
refactor(shared-data): Backport labware schema 3 additions to schema 2 (#17780)
## Overview Goes towards EXEC-1322. ## Test Plan and Hands on Testing None yet. This will be in subsequent PRs. ## Changelog * Copy most of the changes in labware schema 3 to labware schema 2, as discussed in EXEC-1322. * Copy `isDeckSlotCompatible`. * Copy `compatibleParentLabware`. * Copy `innerLabwareGeometry`. * Copy a fix for how we represent the `rectangular`/`circular` well union. (See [#17501](#17501) for background.) * The only remaining differences (and you can diff the files to make sure) are`$otSharedSchema` and `schemaVersion`. * Update Python bindings. * Update TypeScript bindings. * Add a `system` `displayCategory` to both labware schemas so `protocol_engine_lid_stack_object` actually validates. Closes EXEC-1265. Not done here, and will be in a separate PR: updating `api` to make sure it uses these new features even in schema 2. ## Review requests Anyone want a different resolution to EXEC-1265, other than adding a `system` `displayCategory`? ## Risk assessment Low. There's a small risk that the `rectangular`/`circular` well union fix will "break" some buggy custom labware definition out in the wild, since it's making validation stricter. I weigh this less than the risks of *not* doing the fix: the buggy labware could break in more obscure ways when it hits internal code; new bugs could sneak in when we're adding standard labware definitions; and schemas 2 and 3 could accidentally fall out of sync with each other because they look very different and can't easily be diffed.
1 parent 235f84b commit dc7d164

File tree

6 files changed

+423
-99
lines changed

6 files changed

+423
-99
lines changed

shared-data/js/__tests__/labwareDefSchemaV3.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,8 @@ describe(`test labware definitions with schema v3`, () => {
7777
const valid = validate(labwareDef)
7878
const validationErrors = validate.errors
7979

80-
// FIXME(mm, 2025-02-04): These new definitions have a displayCategory that
81-
// the schema does not recognize. Either they need to change or the schema does.
82-
const expectFailure = ['protocol_engine_lid_stack_object'].includes(
83-
labwareDef.parameters.loadName
84-
)
85-
86-
if (expectFailure) expect(validationErrors).not.toBe(null)
87-
else expect(validationErrors).toBe(null)
88-
expect(valid).toBe(!expectFailure)
80+
expect(validationErrors).toBe(null)
81+
expect(valid).toBe(true)
8982
})
9083

9184
checkGeometryDefinitions(labwareDef)

shared-data/js/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export interface LabwareParameters {
126126
isTiprack: boolean
127127
tipLength?: number
128128
isMagneticModuleCompatible: boolean
129+
isDeckSlotCompatible?: boolean
129130
magneticModuleEngageHeight?: number
130131
quirks?: string[]
131132
}
@@ -260,6 +261,8 @@ export interface LabwareDefinition2 {
260261
stackingOffsetWithLabware?: Record<string, LabwareOffset>
261262
stackingOffsetWithModule?: Record<string, LabwareOffset>
262263
stackLimit?: number
264+
compatibleParentLabware?: string[]
265+
innerLabwareGeometry?: Record<string, InnerWellGeometry> | null
263266
}
264267

265268
export interface LabwareDefinition3 {
@@ -278,6 +281,8 @@ export interface LabwareDefinition3 {
278281
allowedRoles?: LabwareRoles[]
279282
stackingOffsetWithLabware?: Record<string, LabwareOffset>
280283
stackingOffsetWithModule?: Record<string, LabwareOffset>
284+
stackLimit?: number
285+
compatibleParentLabware?: string[]
281286
innerLabwareGeometry?: Record<string, InnerWellGeometry> | null
282287
}
283288

0 commit comments

Comments
 (0)