Skip to content

Commit

Permalink
fix(step-generation): account for adapter in 4th column slot timeline…
Browse files Browse the repository at this point in the history
… error (#15087)

closes AUTH-381
  • Loading branch information
jerader authored May 3, 2024
1 parent fea3ee7 commit 94faec4
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 19 deletions.
3 changes: 1 addition & 2 deletions protocol-designer/src/load-file/migration/8_1_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ export const migrateFile = (
const matchingTiprackCommand = tiprackLoadCommands.find(
command => command.params.labwareId === item.tipRack
)

if (matchingTiprackCommand == null) {
console.error(
`expected to find a tiprack loadname from tiprack ${item.tiprack} but could not `
`expected to find a tiprack loadname from tiprack ${item.tipRack} but could not `
)
}
const matchingTiprackURI =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export function getDefaultBlowoutFlowRate(
matchingTipLiquidSpecs,
`expected to find the tip liquid specs but could not with pipetteName ${pipetteName}`
)
console.log(pipetteName, volume, tipLength)

return matchingTipLiquidSpecs.defaultBlowOutFlowRate.default
}
26 changes: 14 additions & 12 deletions protocol-designer/src/step-forms/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1381,11 +1381,13 @@ export const additionalEquipmentInvariantProperties = handleActions<NormalizedAd
]),
]

const unoccupiedSlotForMovableTrash = getUnoccupiedSlotForMoveableTrash(
file,
hasWasteChuteCommands,
stagingAreaSlotNames
)
const unoccupiedSlotForMovableTrash = hasWasteChuteCommands
? ''
: getUnoccupiedSlotForMoveableTrash(
file,
hasWasteChuteCommands,
stagingAreaSlotNames
)

const stagingAreas = stagingAreaSlotNames.reduce((acc, slot) => {
const stagingAreaId = `${uuid()}:stagingArea`
Expand Down Expand Up @@ -1460,7 +1462,6 @@ export const additionalEquipmentInvariantProperties = handleActions<NormalizedAd
} else if (mixStepTrashBin != null) {
trashBinId = mixStepTrashBin.dropTip_location
}

const trashCutoutId =
trashAddressableAreaName != null
? getCutoutIdByAddressableArea(
Expand Down Expand Up @@ -1557,14 +1558,15 @@ export const additionalEquipmentInvariantProperties = handleActions<NormalizedAd
[hardcodedTrashBinIdFlex]: {
name: 'trashBin' as const,
id: hardcodedTrashBinIdFlex,
location: getCutoutIdByAddressableArea(
hardcodedTrashAddressableAreaName as AddressableAreaName,
'trashBinAdapter',
FLEX_ROBOT_TYPE
),
location: hasWasteChuteCommands
? ''
: getCutoutIdByAddressableArea(
hardcodedTrashAddressableAreaName as AddressableAreaName,
'trashBinAdapter',
FLEX_ROBOT_TYPE
),
},
}

if (isFlex) {
if (trashBin != null) {
return {
Expand Down
8 changes: 8 additions & 0 deletions step-generation/src/commandCreators/atomic/aspirate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const aspirate: CommandCreator<ExtendedAspirateParams> = (
yOffset,
} = args
const actionName = 'aspirate'
const labwareState = prevRobotState.labware
const errors: CommandCreatorError[] = []
const pipetteSpec = invariantContext.pipetteEntities[pipette]?.spec
const isFlexPipette =
Expand Down Expand Up @@ -75,6 +76,13 @@ export const aspirate: CommandCreator<ExtendedAspirateParams> = (

if (COLUMN_4_SLOTS.includes(slotName)) {
errors.push(errorCreators.pipettingIntoColumn4({ typeOfStep: actionName }))
} else if (labwareState[slotName] != null) {
const adapterSlot = labwareState[slotName].slot
if (COLUMN_4_SLOTS.includes(adapterSlot)) {
errors.push(
errorCreators.pipettingIntoColumn4({ typeOfStep: actionName })
)
}
}

if (
Expand Down
8 changes: 8 additions & 0 deletions step-generation/src/commandCreators/atomic/blowout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const blowout: CommandCreator<BlowoutParams> = (
const actionName = 'blowout'
const errors: CommandCreatorError[] = []
const pipetteData = prevRobotState.pipettes[pipetteId]
const labwareState = prevRobotState.labware
const slotName = getLabwareSlot(
labwareId,
prevRobotState.labware,
Expand Down Expand Up @@ -56,6 +57,13 @@ export const blowout: CommandCreator<BlowoutParams> = (

if (COLUMN_4_SLOTS.includes(slotName)) {
errors.push(errorCreators.pipettingIntoColumn4({ typeOfStep: actionName }))
} else if (labwareState[slotName] != null) {
const adapterSlot = labwareState[slotName].slot
if (COLUMN_4_SLOTS.includes(adapterSlot)) {
errors.push(
errorCreators.pipettingIntoColumn4({ typeOfStep: actionName })
)
}
}

if (errors.length > 0) {
Expand Down
8 changes: 8 additions & 0 deletions step-generation/src/commandCreators/atomic/dispense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const dispense: CommandCreator<ExtendedDispenseParams> = (
yOffset,
} = args
const actionName = 'dispense'
const labwareState = prevRobotState.labware
const errors: CommandCreatorError[] = []
const pipetteSpec = invariantContext.pipetteEntities[pipette]?.spec
const isFlexPipette =
Expand Down Expand Up @@ -93,6 +94,13 @@ export const dispense: CommandCreator<ExtendedDispenseParams> = (

if (COLUMN_4_SLOTS.includes(slotName)) {
errors.push(errorCreators.pipettingIntoColumn4({ typeOfStep: actionName }))
} else if (labwareState[slotName] != null) {
const adapterSlot = labwareState[slotName].slot
if (COLUMN_4_SLOTS.includes(adapterSlot)) {
errors.push(
errorCreators.pipettingIntoColumn4({ typeOfStep: actionName })
)
}
}

if (
Expand Down
8 changes: 8 additions & 0 deletions step-generation/src/commandCreators/atomic/moveToWell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const moveToWell: CommandCreator<v5MoveToWellParams> = (
const { pipette, labware, well, offset, minimumZHeight, forceDirect } = args
const actionName = 'moveToWell'
const errors: CommandCreatorError[] = []
const labwareState = prevRobotState.labware
// TODO(2020-07-30, IL): the below is duplicated or at least similar
// across aspirate/dispense/blowout, we can probably DRY it up
const pipetteSpec = invariantContext.pipetteEntities[pipette]?.spec
Expand Down Expand Up @@ -63,6 +64,13 @@ export const moveToWell: CommandCreator<v5MoveToWellParams> = (
errors.push(
errorCreators.pipettingIntoColumn4({ typeOfStep: 'move to well' })
)
} else if (labwareState[slotName] != null) {
const adapterSlot = labwareState[slotName].slot
if (COLUMN_4_SLOTS.includes(adapterSlot)) {
errors.push(
errorCreators.pipettingIntoColumn4({ typeOfStep: actionName })
)
}
}

if (
Expand Down
7 changes: 7 additions & 0 deletions step-generation/src/commandCreators/atomic/replaceTip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ const _pickUpTip: CommandCreator<PickUpTipArgs> = (
errors.push(
errorCreators.pipettingIntoColumn4({ typeOfStep: 'pick up tip' })
)
} else if (prevRobotState.labware[tiprackSlot] != null) {
const adapterSlot = prevRobotState.labware[tiprackSlot].slot
if (COLUMN_4_SLOTS.includes(adapterSlot)) {
errors.push(
errorCreators.pipettingIntoColumn4({ typeOfStep: 'pick up tip' })
)
}
}

if (errors.length > 0) {
Expand Down
10 changes: 6 additions & 4 deletions step-generation/src/robotStateSelectors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import assert from 'assert'
// TODO: Ian 2019-04-18 move orderWells somewhere more general -- shared-data util?
import min from 'lodash/min'
import {
Expand Down Expand Up @@ -77,7 +76,10 @@ export function _getNextTip(args: {
return allWellsHaveTip ? orderedWells[0] : null
}

assert(false, `Pipette ${pipetteId} has no channels/spec, cannot _getNextTip`)
console.assert(
false,
`Pipette ${pipetteId} has no channels/spec, cannot _getNextTip`
)
return null
}
interface NextTiprackInfo {
Expand Down Expand Up @@ -110,7 +112,7 @@ export function getNextTiprack(
// filter out unmounted or non-compatible tiprack models
const sortedTipracksIds = sortLabwareBySlot(robotState.labware).filter(
labwareId => {
assert(
console.assert(
invariantContext.labwareEntities[labwareId]?.labwareDefURI,
`cannot getNextTiprack, no labware entity for "${labwareId}"`
)
Expand Down Expand Up @@ -202,7 +204,7 @@ export function getPipetteWithTipMaxVol(
const tiprackTipVol = getTiprackVolume(chosenTipRack ?? tiprackDef[0])

if (!pipetteMaxVol || !tiprackTipVol) {
assert(
console.assert(
false,
`getPipetteEffectiveMaxVol expected tiprackMaxVol and pipette maxVolume to be > 0, got',
${pipetteMaxVol}, ${tiprackTipVol}`
Expand Down

0 comments on commit 94faec4

Please sign in to comment.