Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions step-generation/src/__tests__/airGapInTrash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,11 @@ describe('airGapInTrash', () => {
},
},
])
expect(getSuccessResult(result).python).toBe(
`
mock_pipette.move_to(mock_trash_bin_1)
mock_pipette.air_gap(volume=10, in_place=True, flow_rate=10)
`.trim()
)
})
})
6 changes: 6 additions & 0 deletions step-generation/src/__tests__/airGapInWasteChute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,11 @@ describe('airGapInWasteChute', () => {
},
},
])
expect(getSuccessResult(result).python).toBe(
`
mock_pipette.move_to(mock_waste_chute_1)
mock_pipette.air_gap(volume=10, in_place=True, flow_rate=10)
`.trim()
)
})
})
8 changes: 7 additions & 1 deletion step-generation/src/commandCreators/atomic/airGapInPlace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ export const airGapInPlace: CommandCreator<AirGapInPlaceParams> = (
const { flowRate, pipetteId, volume } = args
const errors: CommandCreatorError[] = []
const pipetteSpec = invariantContext.pipetteEntities[pipetteId]?.spec

if (!pipetteSpec) {
errors.push(
pipetteDoesNotExist({
pipette: pipetteId,
})
)
}
const pipettePythonName =
invariantContext.pipetteEntities[pipetteId].pythonName

const commands = [
{
Expand All @@ -34,5 +35,10 @@ export const airGapInPlace: CommandCreator<AirGapInPlaceParams> = (
]
return {
commands,
python: `${pipettePythonName}.air_gap(${[
`volume=${volume}`,
`in_place=True`,
`flow_rate=${flowRate}`,
].join(', ')})`,
}
}
9 changes: 7 additions & 2 deletions step-generation/src/commandCreators/compound/airGapInTrash.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { ZERO_OFFSET } from '../../constants'
import { curryCommandCreator, reduceCommandCreators } from '../../utils'
import {
curryCommandCreator,
curryWithoutPython,
reduceCommandCreators,
} from '../../utils'
import {
airGapInPlace,
moveToAddressableArea,
Expand All @@ -26,7 +30,8 @@ export const airGapInTrash: CommandCreator<AirGapInTrashParams> = (
fixtureId: trashId,
offset: ZERO_OFFSET,
}),
curryCommandCreator(prepareToAspirate, {
curryWithoutPython(prepareToAspirate, {
// PAPI air_gap() includes prepare_to_aspirate() so don't emit Python
pipetteId,
}),
curryCommandCreator(airGapInPlace, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { ZERO_OFFSET } from '../../constants'
import { curryCommandCreator, reduceCommandCreators } from '../../utils'
import {
curryCommandCreator,
curryWithoutPython,
reduceCommandCreators,
} from '../../utils'
import {
airGapInPlace,
moveToAddressableArea,
Expand Down Expand Up @@ -28,7 +32,8 @@ export const airGapInWasteChute: CommandCreator<AirGapInWasteChuteArgs> = (
fixtureId: wasteChuteId,
offset: ZERO_OFFSET,
}),
curryCommandCreator(prepareToAspirate, {
curryWithoutPython(prepareToAspirate, {
// PAPI air_gap() includes prepare_to_aspirate() so don't emit Python
pipetteId,
}),
curryCommandCreator(airGapInPlace, {
Expand Down