Skip to content

Commit 1667af8

Browse files
authored
fix(step-generation): pass trash_location arg if return tip and blowout (#20181)
If a user specifies 1) return tip with 2) blowout enabled 3) in a trash-like entity, we need to pass a `trash_location` Python arg accordingly.
1 parent b6a1f1f commit 1667af8

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,7 @@ mock_pipette.distribute_with_liquid_class(
22782278
dest=[mock_dest_plate["A2"], mock_dest_plate["A3"], mock_dest_plate["A4"]],
22792279
new_tip="always",
22802280
return_tip=True,
2281+
trash_location=trash_bin_1,
22812282
tip_racks=[mock_tip_rack_1, mock_tip_rack_2],
22822283
liquid_class=protocol.define_liquid_class(
22832284
name="distribute_step_1",
@@ -2378,6 +2379,7 @@ mock_pipette.distribute_with_liquid_class(
23782379
dest=[mock_dest_plate["A2"], mock_dest_plate["A3"], mock_dest_plate["A4"]],
23792380
new_tip="always",
23802381
return_tip=True,
2382+
trash_location=trash_bin_1,
23812383
tip_racks=[mock_tip_rack_1, mock_tip_rack_2],
23822384
liquid_class=protocol.define_liquid_class(
23832385
name="distribute_step_1",

step-generation/src/commandCreators/compound/consolidate.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,11 @@ export const consolidate: CommandCreator<ConsolidateArgs> = (
370370
const trashPipetteName =
371371
trashBinEntities[dropTipLocation]?.pythonName ??
372372
wasteChuteEntities[dropTipLocation]?.pythonName
373+
const blowoutTrashPythonName =
374+
blowoutLocation == null
375+
? null
376+
: (trashBinEntities[blowoutLocation]?.pythonName ??
377+
wasteChuteEntities[blowoutLocation]?.pythonName)
373378
const sourceLabwarePythonName = labwareEntities[sourceLabware].pythonName
374379
const destLabwarePythonName = labwareEntities[destLabware]?.pythonName
375380
const pythonSourceWells = sourceWells
@@ -433,8 +438,13 @@ export const consolidate: CommandCreator<ConsolidateArgs> = (
433438
}`,
434439
`new_tip=${formatPyStr(formatChangeTipArg(changeTip))}`,
435440
...(isReturnTip
436-
? [`return_tip=True`]
437-
: [`trash_location=${trashPipetteName}`, `keep_last_tip=True`]),
441+
? [
442+
'return_tip=True',
443+
...(blowoutTrashPythonName != null
444+
? [`trash_location=${blowoutTrashPythonName}`]
445+
: []),
446+
]
447+
: [`trash_location=${trashPipetteName}`, 'keep_last_tip=True']),
438448
...(pipetteSpecs.channels > 1 ? [`group_wells=False`] : []),
439449
...(tipracks.filteredSortedTiprackIds.length > 0
440450
? [

step-generation/src/commandCreators/compound/distribute.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ export const distribute: CommandCreator<DistributeArgs> = (
416416
const trashPipetteName =
417417
trashBinEntities[dropTipLocation]?.pythonName ??
418418
wasteChuteEntities[dropTipLocation]?.pythonName
419+
const blowoutTrashPythonName =
420+
blowoutLocation == null
421+
? null
422+
: (trashBinEntities[blowoutLocation]?.pythonName ??
423+
wasteChuteEntities[blowoutLocation]?.pythonName)
419424
const sourceLabwarePythonName = labwareEntities[sourceLabware].pythonName
420425
const destLabwarePythonName = labwareEntities[destLabware]?.pythonName
421426
const pythonSourceWells = `${sourceLabwarePythonName}[${formatPyStr(
@@ -476,8 +481,13 @@ export const distribute: CommandCreator<DistributeArgs> = (
476481
`dest=[${pythonDestWells ?? destTrashPipetteName}]`,
477482
`new_tip=${formatPyStr(formatChangeTipArg(changeTip))}`,
478483
...(isReturnTip
479-
? [`return_tip=True`]
480-
: [`trash_location=${trashPipetteName}`, `keep_last_tip=True`]),
484+
? [
485+
'return_tip=True',
486+
...(blowoutTrashPythonName != null
487+
? [`trash_location=${blowoutTrashPythonName}`]
488+
: []),
489+
]
490+
: [`trash_location=${trashPipetteName}`, 'keep_last_tip=True']),
481491
...(pipetteSpecs.channels > 1 ? [`group_wells=False`] : []),
482492
...(tipracks.filteredSortedTiprackIds.length > 0
483493
? [

step-generation/src/commandCreators/compound/transfer.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,11 @@ export const transfer: CommandCreator<TransferArgs> = (
412412
const trashPipetteName =
413413
trashBinEntities[dropTipLocation]?.pythonName ??
414414
wasteChuteEntities[dropTipLocation]?.pythonName
415+
const blowoutTrashPythonName =
416+
blowoutLocation == null
417+
? null
418+
: (trashBinEntities[blowoutLocation]?.pythonName ??
419+
wasteChuteEntities[blowoutLocation]?.pythonName)
415420
const sourceLabwarePythonName = labwareEntities[sourceLabware].pythonName
416421
const destLabwarePythonName = labwareEntities[destLabware]?.pythonName
417422
const pythonSourceWells = sourceWells
@@ -477,8 +482,13 @@ export const transfer: CommandCreator<TransferArgs> = (
477482
}`,
478483
`new_tip=${formatPyStr(formatChangeTipArg(changeTip))}`,
479484
...(isReturnTip
480-
? [`return_tip=True`]
481-
: [`trash_location=${trashPipetteName}`, `keep_last_tip=True`]),
485+
? [
486+
'return_tip=True',
487+
...(blowoutTrashPythonName != null
488+
? [`trash_location=${blowoutTrashPythonName}`]
489+
: []),
490+
]
491+
: [`trash_location=${trashPipetteName}`, 'keep_last_tip=True']),
482492
...(pipetteSpecs.channels > 1 ? [`group_wells=False`] : []),
483493
...(tipracks.filteredSortedTiprackIds.length > 0
484494
? [

0 commit comments

Comments
 (0)