Skip to content

Commit ac7760b

Browse files
authored
fix(step-generation): add back version for load_labware and load_adapter (#19009)
We should have the version number for the `load_adapter` and `load_labware` commands so its more accurate to what the uses adds in PD. The previous bug that errored requirement inner well geometries for API 2.24 was fixed by Sanniti.
1 parent ebc0900 commit ac7760b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

protocol-designer/src/file-data/__tests__/createFile.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,14 @@ def run(protocol: protocol_api.ProtocolContext) -> None:
166166
location="1",
167167
label="Opentrons 96 Tip Rack 10 µL",
168168
namespace="opentrons",
169+
version=1,
169170
)
170171
mock_python_name_3 = protocol.load_labware(
171172
"fixture_96_plate",
172173
location="7",
173174
label="NEST 96 Well Plate 100 µL PCR Full Skirt",
174175
namespace="opentrons",
176+
version=1,
175177
)
176178
177179
# Load Pipettes:

step-generation/src/__tests__/pythonFileUtils.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ describe('getLoadAdapters', () => {
213213
adapter_1 = magnetic_block_1.load_adapter(
214214
"fixture_flex_96_tiprack_adapter",
215215
namespace="opentrons",
216+
version=1,
216217
)
217218
adapter_2 = protocol.load_adapter_from_definition(
218219
CUSTOM_LABWARE["fixture/fixture_flex_96_tiprack_adapter/1"],
@@ -238,10 +239,12 @@ well_plate_1 = adapter_2.load_labware(
238239
"fixture_96_plate",
239240
label="reagent plate",
240241
namespace="opentrons",
242+
version=1,
241243
)
242244
well_plate_2 = magnetic_block_2.load_labware(
243245
"fixture_96_plate",
244246
namespace="opentrons",
247+
version=1,
245248
)
246249
well_plate_3 = protocol.load_labware_from_definition(
247250
CUSTOM_LABWARE["fixture/fixture_96_plate/1"],
@@ -274,6 +277,7 @@ well_plate_5 = protocol.load_labware(
274277
"fixture_96_plate",
275278
location=protocol_api.OFF_DECK,
276279
namespace="opentrons",
280+
version=1,
277281
)`.trimStart()
278282
)
279283
})

step-generation/src/utils/pythonFileUtils.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function getLoadAdapters(
114114
const pythonAdapters = Object.values(adapterEntities)
115115
.map(adapter => {
116116
const { id, def, pythonName } = adapter
117-
const { parameters, namespace } = def
117+
const { parameters, namespace, version } = def
118118
// 2nd item in stack is the slot the adapter is on
119119
const adapterSlot = labwareRobotState[id].stack[1]
120120
const onModule = moduleEntities[adapterSlot] != null
@@ -136,10 +136,7 @@ export function getLoadAdapters(
136136
`${formatPyStr(parameters.loadName)}`,
137137
...(locationArg ? [locationArg] : []),
138138
`namespace=${formatPyStr(namespace)}`,
139-
// NOTE: temporarily removing version number
140-
// until PD migrated labware defs to the latest version
141-
// upon re-import
142-
// `version=${version}`,
139+
`version=${version}`,
143140
].join(',\n')
144141
return (
145142
`${pythonName} = ${parentName}.load_adapter(\n` +
@@ -176,7 +173,7 @@ export function getLoadLabware(
176173
const pythonLabware = Object.values(labwareEntities)
177174
.map(labware => {
178175
const { id, def, pythonName } = labware
179-
const { metadata, parameters, namespace } = def
176+
const { metadata, parameters, namespace, version } = def
180177
const hasNickname =
181178
labwareNicknamesById[id] != null &&
182179
labwareNicknamesById[id] !== metadata.displayName
@@ -208,10 +205,7 @@ export function getLoadLabware(
208205
...(locationArg ? [locationArg] : []),
209206
...(labelArg ? [labelArg] : []),
210207
`namespace=${formatPyStr(namespace)}`,
211-
// NOTE: temporarily removing version number
212-
// until PD migrated labware defs to the latest version
213-
// upon re-import
214-
// `version=${version}`,
208+
`version=${version}`,
215209
].join(',\n')
216210
return (
217211
`${pythonName} = ${parentName}.load_labware(\n` +

0 commit comments

Comments
 (0)