File tree Expand file tree Collapse file tree 5 files changed +34
-7
lines changed Expand file tree Collapse file tree 5 files changed +34
-7
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
} from '@opentrons/shared-data'
20
20
21
21
import {
22
+ formatChangeTipArg ,
22
23
getDefineLiquids ,
23
24
getLoadAdapters ,
24
25
getLoadLabware ,
@@ -570,3 +571,15 @@ glycerol_50_base_class = protocol.get_liquid_class("glycerol_50")`.trimStart()
570
571
)
571
572
} )
572
573
} )
574
+
575
+ describe ( 'formatChangeTipArg' , ( ) => {
576
+ it ( 'should transform perSource into per source' , ( ) => {
577
+ expect ( formatChangeTipArg ( 'perSource' ) ) . toBe ( 'per source' )
578
+ } )
579
+ it ( 'should transform perDest into per destination' , ( ) => {
580
+ expect ( formatChangeTipArg ( 'perDest' ) ) . toBe ( 'per destination' )
581
+ } )
582
+ it ( 'should not alter never' , ( ) => {
583
+ expect ( formatChangeTipArg ( 'never' ) ) . toBe ( 'never' )
584
+ } )
585
+ } )
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
22
22
curryCommandCreator ,
23
23
curryWithoutPython ,
24
24
DEST_WELL_BLOWOUT_DESTINATION ,
25
+ formatChangeTipArg ,
25
26
formatPyStr ,
26
27
getIsRetractSafeForAirGap ,
27
28
getIsSafePipetteMovement ,
@@ -373,9 +374,7 @@ export const consolidate: CommandCreator<ConsolidateArgs> = (
373
374
`dest=${
374
375
pythonDestWells != null ? `[${ pythonDestWells } ]` : destTrashPipetteName
375
376
} `,
376
- // TODO: fix bug where new_tip api arg does not allow
377
- // changeTip: always but PD does
378
- `new_tip=${ formatPyStr ( changeTip ) } ` ,
377
+ `new_tip=${ formatPyStr ( formatChangeTipArg ( changeTip ) ) } ` ,
379
378
`trash_location=${ trashPipetteName } ` ,
380
379
...( pipetteSpecs . channels > 1 ? [ `group_wells=False` ] : [ ] ) ,
381
380
`keep_last_tip=True` ,
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
23
23
curryCommandCreator ,
24
24
curryWithoutPython ,
25
25
DEST_WELL_BLOWOUT_DESTINATION ,
26
+ formatChangeTipArg ,
26
27
formatPyStr ,
27
28
getIsRetractSafeForAirGap ,
28
29
getIsSafePipetteMovement ,
@@ -405,9 +406,7 @@ export const distribute: CommandCreator<DistributeArgs> = (
405
406
`volume=${ volume } ` ,
406
407
`source=[${ pythonSourceWells } ]` ,
407
408
`dest=[${ pythonDestWells ?? destTrashPipetteName } ]` ,
408
- // TODO: fix bug where new_tip api arg does not allow
409
- // changeTip: always but PD does
410
- `new_tip=${ formatPyStr ( changeTip ) } ` ,
409
+ `new_tip=${ formatPyStr ( formatChangeTipArg ( changeTip ) ) } ` ,
411
410
`trash_location=${ trashPipetteName } ` ,
412
411
...( pipetteSpecs . channels > 1 ? [ `group_wells=False` ] : [ ] ) ,
413
412
`keep_last_tip=True` ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
curryCommandCreator ,
20
20
curryWithoutPython ,
21
21
DEST_WELL_BLOWOUT_DESTINATION ,
22
+ formatChangeTipArg ,
22
23
formatPyStr ,
23
24
getIsRetractSafeForAirGap ,
24
25
getSlotInLocationStack ,
@@ -376,7 +377,7 @@ export const transfer: CommandCreator<TransferArgs> = (
376
377
`dest=${
377
378
pythonDestWells != null ? `[${ pythonDestWells } ]` : destTrashPipetteName
378
379
} `,
379
- `new_tip=${ formatPyStr ( changeTip ) } ` ,
380
+ `new_tip=${ formatPyStr ( formatChangeTipArg ( changeTip ) ) } ` ,
380
381
`trash_location=${ trashPipetteName } ` ,
381
382
...( pipetteSpecs . channels > 1 ? [ `group_wells=False` ] : [ ] ) ,
382
383
`keep_last_tip=True` ,
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import {
24
24
25
25
import type { CutoutId , ProtocolFile , RobotType } from '@opentrons/shared-data'
26
26
import type {
27
+ ChangeTipOptions ,
27
28
InvariantContext ,
28
29
LabwareEntities ,
29
30
LabwareEntity ,
@@ -511,3 +512,17 @@ export function pythonCustomLabwareDict(
511
512
return ''
512
513
}
513
514
}
515
+
516
+ export const formatChangeTipArg = ( changeTip : ChangeTipOptions ) : string => {
517
+ switch ( changeTip ) {
518
+ case 'perDest' : {
519
+ return 'per destination'
520
+ }
521
+ case 'perSource' : {
522
+ return 'per source'
523
+ }
524
+ default : {
525
+ return changeTip
526
+ }
527
+ }
528
+ }
You can’t perform that action at this time.
0 commit comments