Skip to content

Commit 05d2623

Browse files
authored
fix(protocol-designer): fix max conditioning volume (#18737)
This PR fixes the logic for determining the max conditioning volume allowed in a multiDispense transfer. We should always leave room enough in the tip to accommodate a minimum of 2 destinations-worth of volume.
1 parent 1af733f commit 05d2623

File tree

3 files changed

+11
-45
lines changed

3 files changed

+11
-45
lines changed

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/SecondStepsMoveLiquidTools.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ export const SecondStepsMoveLiquidTools = ({
405405
>
406406
{formData.conditioning_checkbox === true ? (
407407
<InputStepFormField
408+
{...propsForFields.conditioning_volume}
408409
title={t(
409410
'form:step_edit_form.field.conditioning.conditioning_volume.label'
410411
)}
@@ -413,7 +414,6 @@ export const SecondStepsMoveLiquidTools = ({
413414
{ min: 0, max: maxConditioningVolume }
414415
)}
415416
padding="0"
416-
{...propsForFields.conditioning_volume}
417417
showTooltip={false}
418418
/>
419419
) : null}

protocol-designer/src/utils/__tests__/utils.test.ts

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -149,46 +149,7 @@ describe('getMaxConditioningVolume', () => {
149149
} as any
150150

151151
const result = getMaxConditioningVolume(args)
152-
expect(result).toBe(200 - 5 - 10)
153-
})
154-
155-
it('should calculate the max conditioning volume with low volume liquid specs and tiprack volume', () => {
156-
const args = {
157-
transferVolume: 4,
158-
disposalVolume: 1,
159-
tiprackDefUri: 'opentrons/opentrons_96_tiprack_10ul/1',
160-
labwareEntities: {
161-
tiprack: {
162-
id: 'tiprack',
163-
labwareDefURI: 'opentrons/opentrons_96_tiprack_10ul/1',
164-
def: {
165-
parameters: {
166-
loadName: 'opentrons_96_tiprack_10ul',
167-
},
168-
wells: {
169-
A1: {
170-
totalLiquidVolume: 10,
171-
},
172-
},
173-
},
174-
},
175-
},
176-
pipetteSpecs: {
177-
liquids: {
178-
default: {
179-
maxVolume: 10,
180-
minVolume: 5,
181-
},
182-
lowVolumeDefault: {
183-
maxVolume: 5,
184-
minVolume: 0.1,
185-
},
186-
},
187-
},
188-
} as any
189-
190-
const result = getMaxConditioningVolume(args)
191-
expect(result).toBe(5 - 4 - 1)
152+
expect(result).toBe(200 - 5 - 10 * 2)
192153
})
193154

194155
it('should calculate the max conditioning volume without tiprack volume', () => {
@@ -208,7 +169,7 @@ describe('getMaxConditioningVolume', () => {
208169
} as any
209170

210171
const result = getMaxConditioningVolume(args)
211-
expect(result).toBe(200 - 5 - 10)
172+
expect(result).toBe(200 - 5 - 10 * 2)
212173
})
213174

214175
it('should handle zero disposal volume', () => {
@@ -243,6 +204,6 @@ describe('getMaxConditioningVolume', () => {
243204
} as any
244205

245206
const result = getMaxConditioningVolume(args)
246-
expect(result).toBe(200 - 10)
207+
expect(result).toBe(200 - 10 * 2)
247208
})
248209
})

protocol-designer/src/utils/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,10 @@ export const getMaxConditioningVolume = (args: {
378378
pipetteSpecs,
379379
} = args
380380
const { liquids } = pipetteSpecs
381+
const minVolumeForMultiDispense = transferVolume * 2
381382
const isInLowVolumeMode =
382-
transferVolume < liquids.default.minVolume && 'lowVolumeDefault' in liquids
383+
minVolumeForMultiDispense < liquids.default.minVolume &&
384+
'lowVolumeDefault' in liquids
383385
const tiprack = Object.values(labwareEntities).find(
384386
({ labwareDefURI }) => labwareDefURI === tiprackDefUri
385387
)
@@ -391,7 +393,10 @@ export const getMaxConditioningVolume = (args: {
391393
: liquids.default.maxVolume,
392394
...(tipMaxVolume != null ? [tipMaxVolume] : [])
393395
)
394-
return maxWorkingVolume - disposalVolume - transferVolume
396+
return Math.max(
397+
0,
398+
maxWorkingVolume - disposalVolume - minVolumeForMultiDispense
399+
)
395400
}
396401

397402
// for stacking

0 commit comments

Comments
 (0)