Skip to content

Commit 0346070

Browse files
committed
fix(protocol-designer): consider consolidation in well overflow warning
This PR extends the logic in `maxDispenseWellVolume` to consider whether multiple aspirate wells are being transferred to the same dispense wells. In the event that the transfer is many-to-1, we should multiply the transfer volume by the number of aspirate wells to determine whether the destination well will overflow. Closes RQA-4272
1 parent 10c8bb4 commit 0346070

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

protocol-designer/src/steplist/formLevel/test/warnings.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ describe('Max dispense well volume', () => {
158158
fieldsWithDispenseLabware = {
159159
dispense_labware: { def: fixture24Tuberack },
160160
dispense_wells: ['A1', 'A2'],
161+
aspirate_wells: ['A1', 'A2'],
161162
}
162163
})
163164
it('should NOT return a warning when there is no dispense labware', () => {

protocol-designer/src/steplist/formLevel/warnings.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,19 @@ export const belowPipetteMinimumVolume = (
144144
export const maxDispenseWellVolume = (
145145
fields: HydratedMoveLiquidFormData
146146
): FormWarning | null => {
147-
const { dispense_labware, dispense_wells, volume } = fields
148-
if (!dispense_labware || !dispense_wells) return null
147+
const { aspirate_wells, dispense_labware, dispense_wells, volume } = fields
148+
if (!dispense_labware || !dispense_wells) {
149+
return null
150+
}
151+
152+
const isManyToOne = aspirate_wells.length > dispense_wells.length
153+
const effectiveVolume = isManyToOne ? volume * aspirate_wells.length : volume
149154
const hasExceeded = dispense_wells.some((well: string) => {
150155
const maximum =
151156
'def' in dispense_labware
152157
? getWellTotalVolume(dispense_labware.def as LabwareDefinition2, well)
153158
: Infinity
154-
return maximum && volume > maximum
159+
return maximum && effectiveVolume > maximum
155160
})
156161
return hasExceeded ? overMaxWellVolumeWarning() : null
157162
}

0 commit comments

Comments
 (0)