Skip to content

Commit 1ec81e0

Browse files
authored
fix(step-generation): blowout waste chute QT bug (#18904)
closes AUTH-2088
1 parent f36195a commit 1ec81e0

File tree

4 files changed

+72
-32
lines changed

4 files changed

+72
-32
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
DEFAULT_PIPETTE,
1212
SOURCE_LABWARE,
1313
DEST_LABWARE,
14-
TROUGH_LABWARE,
1514
BLOWOUT_FLOW_RATE,
1615
BLOWOUT_OFFSET_FROM_TOP_MM,
1716
makeContext,
@@ -118,11 +117,11 @@ describe('blowoutLocationHelper', () => {
118117
it('blowoutLocationHelper curries blowout with an arbitrary labware Id', () => {
119118
blowoutLocationHelper({
120119
...blowoutArgs,
121-
blowoutLocation: TROUGH_LABWARE,
120+
blowoutLocation: 'source_well',
122121
})
123122
expect(curryCommandCreator).toHaveBeenCalledWith(blowOutInWell, {
124123
pipetteId: blowoutArgs.pipette,
125-
labwareId: TROUGH_LABWARE,
124+
labwareId: SOURCE_LABWARE,
126125
wellName: 'A1',
127126
flowRate: blowoutArgs.flowRate,
128127
wellLocation: {

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

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ describe('advanced settings: volume, mix, pre-wet tip, tip touch, tip position',
288288
volume: 120,
289289
mixBeforeAspirate: { times: 2, volume: 50 },
290290
disposalVolume: 12,
291-
blowoutLocation: SOURCE_LABWARE,
291+
blowoutLocation: 'source_well',
292292
} as DistributeArgs
293293
const result = distribute(
294294
distributeArgs,
@@ -724,13 +724,53 @@ describe('advanced settings: volume, mix, pre-wet tip, tip touch, tip position',
724724
aspirateHelper('A1', aspirateVol),
725725
dispenseHelper('A2', volume),
726726
dispenseHelper('A3', volume),
727-
blowoutSingleToSourceA1,
727+
{
728+
commandType: 'moveToAddressableArea',
729+
key: expect.anything(),
730+
params: {
731+
addressableAreaName: 'movableTrashA3',
732+
offset: {
733+
x: 0,
734+
y: 0,
735+
z: 0,
736+
},
737+
pipetteId: 'p300SingleId',
738+
},
739+
},
740+
{
741+
commandType: 'blowOutInPlace',
742+
key: expect.anything(),
743+
params: {
744+
flowRate: 2.3,
745+
pipetteId: 'p300SingleId',
746+
},
747+
},
728748

729749
...mixCommands,
730750
aspirateHelper('A1', aspirateVol),
731751
dispenseHelper('A4', volume),
732752
dispenseHelper('A5', volume),
733-
blowoutSingleToSourceA1,
753+
{
754+
commandType: 'moveToAddressableArea',
755+
key: expect.anything(),
756+
params: {
757+
addressableAreaName: 'movableTrashA3',
758+
offset: {
759+
x: 0,
760+
y: 0,
761+
z: 0,
762+
},
763+
pipetteId: 'p300SingleId',
764+
},
765+
},
766+
{
767+
commandType: 'blowOutInPlace',
768+
key: expect.anything(),
769+
params: {
770+
flowRate: 2.3,
771+
pipetteId: 'p300SingleId',
772+
},
773+
},
734774
])
735775
})
736776

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ describe('mix: advanced options', () => {
221221
volume,
222222
times,
223223
changeTip: 'always',
224-
blowoutLocation: blowoutLabwareId,
224+
blowoutLocation: 'source_well',
225225
wells: ['A1', 'B1', 'C1'],
226226
} as MixArgs
227227

@@ -237,6 +237,8 @@ describe('mix: advanced options', () => {
237237
aspirateHelper(well, volume, mockWellLocation),
238238
dispenseHelper(well, volume, mockWellLocation),
239239
blowoutHelper(blowoutLabwareId, {
240+
wellName: well,
241+
labwareId: 'sourcePlateId',
240242
wellLocation: {
241243
origin: 'top',
242244
offset: {
@@ -254,7 +256,7 @@ describe('mix: advanced options', () => {
254256
volume,
255257
times,
256258
changeTip: 'always',
257-
blowoutLocation: blowoutLabwareId,
259+
blowoutLocation: 'source_well',
258260
touchTip: true,
259261
wells: ['A1', 'B1', 'C1'],
260262
} as MixArgs
@@ -271,6 +273,8 @@ describe('mix: advanced options', () => {
271273
aspirateHelper(well, volume, mockWellLocation),
272274
dispenseHelper(well, volume, mockWellLocation),
273275
blowoutHelper(blowoutLabwareId, {
276+
wellName: well,
277+
labwareId: 'sourcePlateId',
274278
wellLocation: {
275279
origin: 'top',
276280
offset: {
@@ -339,7 +343,7 @@ describe('mix: advanced options', () => {
339343
touchTip: true,
340344
aspirateDelaySeconds: 10,
341345
dispenseDelaySeconds: 12,
342-
blowoutLocation: blowoutLabwareId,
346+
blowoutLocation: 'source_well',
343347
volume,
344348
times,
345349
changeTip: 'always',
@@ -368,6 +372,8 @@ describe('mix: advanced options', () => {
368372
dispenseHelper(well, volume, mockWellLocationCustomXY),
369373
delayCommand(12),
370374
blowoutHelper(blowoutLabwareId, {
375+
wellName: well,
376+
labwareId: 'sourcePlateId',
371377
wellLocation: {
372378
origin: 'top',
373379
offset: {
@@ -436,7 +442,7 @@ mockPythonName.dispense(
436442
)
437443
protocol.delay(seconds=12)
438444
mockPythonName.flow_rate.blow_out = 2.3
439-
mockPythonName.blow_out(mockPythonName["A1"].top(z=3.3))
445+
mockPythonName.blow_out(mockPythonName["B1"].top(z=3.3))
440446
mockPythonName.touch_tip(mockPythonName["B1"], v_offset=-3.4)
441447
mockPythonName.drop_tip()
442448
mockPythonName.pick_up_tip(location=mockPythonName)
@@ -465,7 +471,7 @@ mockPythonName.dispense(
465471
)
466472
protocol.delay(seconds=12)
467473
mockPythonName.flow_rate.blow_out = 2.3
468-
mockPythonName.blow_out(mockPythonName["A1"].top(z=3.3))
474+
mockPythonName.blow_out(mockPythonName["C1"].top(z=3.3))
469475
mockPythonName.touch_tip(mockPythonName["C1"], v_offset=-3.4)`.trimStart()
470476
)
471477
})
@@ -474,7 +480,7 @@ mockPythonName.touch_tip(mockPythonName["C1"], v_offset=-3.4)`.trimStart()
474480
const args: MixArgs = {
475481
...mixinArgs,
476482
touchTip: true,
477-
blowoutLocation: blowoutLabwareId,
483+
blowoutLocation: 'dest_well',
478484
volume,
479485
times,
480486
changeTip: 'always',
@@ -510,7 +516,7 @@ mockPythonName.mix(
510516
location=mockPythonName["B1"].bottom(z=3.2).move(types.Point(x=1, y=1)),
511517
)
512518
mockPythonName.flow_rate.blow_out = 2.3
513-
mockPythonName.blow_out(mockPythonName["A1"].top(z=3.3))
519+
mockPythonName.blow_out(mockPythonName["B1"].top(z=3.3))
514520
mockPythonName.touch_tip(mockPythonName["B1"], v_offset=-3.4)
515521
mockPythonName.drop_tip()
516522
mockPythonName.pick_up_tip(location=mockPythonName)
@@ -522,7 +528,7 @@ mockPythonName.mix(
522528
location=mockPythonName["C1"].bottom(z=3.2).move(types.Point(x=1, y=1)),
523529
)
524530
mockPythonName.flow_rate.blow_out = 2.3
525-
mockPythonName.blow_out(mockPythonName["A1"].top(z=3.3))
531+
mockPythonName.blow_out(mockPythonName["C1"].top(z=3.3))
526532
mockPythonName.touch_tip(mockPythonName["C1"], v_offset=-3.4)`.trimStart()
527533
)
528534
})

step-generation/src/utils/misc.ts

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -340,31 +340,23 @@ export const blowoutLocationHelper = (args: {
340340
offsetFromTopMm,
341341
invariantContext,
342342
} = args
343-
if (!blowoutLocation) return []
344-
const { labwareEntities, additionalEquipmentEntities } = invariantContext
345-
const trashOrLabware = getTrashOrLabware(
346-
labwareEntities,
347-
additionalEquipmentEntities,
348-
destLabwareId
349-
)
343+
if (!blowoutLocation) {
344+
return []
345+
}
346+
const { additionalEquipmentEntities } = invariantContext
347+
350348
let labware: LabwareEntity | null = null
351349
let well: string | null = null
352350
if (blowoutLocation === SOURCE_WELL_BLOWOUT_DESTINATION) {
353351
labware = invariantContext.labwareEntities[sourceLabwareId]
354352
well = sourceWell
355353
} else if (blowoutLocation === DEST_WELL_BLOWOUT_DESTINATION) {
356-
labware =
357-
trashOrLabware === 'labware'
358-
? invariantContext.labwareEntities[destLabwareId]
359-
: null
360-
well = trashOrLabware === 'labware' ? destWell : null
361-
} else {
362-
// if it's not one of the magic strings, it's a labware or waste chute or trash bin id
363-
labware = invariantContext.labwareEntities?.[blowoutLocation]
364-
well = trashOrLabware === 'labware' ? 'A1' : null
354+
labware = invariantContext.labwareEntities[destLabwareId]
355+
356+
well = destWell
365357
}
366358

367-
if (well != null && trashOrLabware === 'labware' && labware != null) {
359+
if (well != null && labware != null) {
368360
return [
369361
curryCommandCreator(blowOutInWell, {
370362
pipetteId: pipette,
@@ -379,7 +371,10 @@ export const blowoutLocationHelper = (args: {
379371
},
380372
}),
381373
]
382-
} else if (trashOrLabware === 'wasteChute') {
374+
} else if (
375+
additionalEquipmentEntities[blowoutLocation] != null &&
376+
additionalEquipmentEntities[blowoutLocation].name === 'wasteChute'
377+
) {
383378
const wasteChute = Object.values(additionalEquipmentEntities).find(
384379
ae => ae.name === 'wasteChute'
385380
)

0 commit comments

Comments
 (0)