Skip to content

Commit d72ee2c

Browse files
authored
refactor(step-generation): airGap to occur at the top of the well (#17813)
Some refactoring so air gap occurs at the top of the well and then the subsequent `dispense` to dispense the air gap occurs at the same position. I'm pretty sure this doesn't change protocol behavior, we are just changing the well location origin from `bottom` to `top` and then adjusting the z-offset accordingly. I just changed the `dispense` air gap origin/z-offset to match for simplicity.
1 parent f90d568 commit d72ee2c

File tree

10 files changed

+216
-286
lines changed

10 files changed

+216
-286
lines changed

step-generation/src/__tests__/airGapInWell.test.ts

+51-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import {
66
SOURCE_LABWARE,
77
DEST_LABWARE,
88
} from '../fixtures'
9+
import { AIR_GAP_OFFSET_FROM_TOP } from '../constants'
910
import { airGapInWell } from '../commandCreators/compound'
1011
import type { RobotState, InvariantContext } from '../types'
12+
import type { AirGapInWellType } from '../commandCreators/compound/airGapInWell'
1113

1214
describe('airGapInWell', () => {
1315
let invariantContext: InvariantContext
@@ -17,14 +19,14 @@ describe('airGapInWell', () => {
1719
invariantContext = makeContext()
1820
robotStateWithTip = getRobotStateWithTipStandard(invariantContext)
1921
})
20-
it('air gap in 1 well for transfer', () => {
22+
it('air gap in 1 well for transfer dispense', () => {
2123
const args = {
2224
flowRate: 10,
23-
offsetFromBottomMm: 1,
2425
pipetteId: 'p10SingleId',
2526
volume: 10,
2627
labwareId: SOURCE_LABWARE,
2728
wellName: 'B1',
29+
type: 'dispense' as AirGapInWellType,
2830
}
2931

3032
const result = airGapInWell(args, invariantContext, robotStateWithTip)
@@ -40,9 +42,9 @@ describe('airGapInWell', () => {
4042
offset: {
4143
x: 0,
4244
y: 0,
43-
z: 1,
45+
z: AIR_GAP_OFFSET_FROM_TOP,
4446
},
45-
origin: 'bottom',
47+
origin: 'top',
4648
},
4749
wellName: 'B1',
4850
},
@@ -65,14 +67,14 @@ describe('airGapInWell', () => {
6567
},
6668
])
6769
})
68-
it('air gap for multi wells for consolidate', () => {
70+
it('air gap for multi wells for consolidate dispense', () => {
6971
const args = {
7072
labwareId: DEST_LABWARE,
7173
wellName: 'A1',
7274
flowRate: 10,
73-
offsetFromBottomMm: 1,
7475
pipetteId: 'p10SingleId',
7576
volume: 10,
77+
type: 'dispense' as AirGapInWellType,
7678
}
7779

7880
const result = airGapInWell(args, invariantContext, robotStateWithTip)
@@ -88,9 +90,9 @@ describe('airGapInWell', () => {
8890
offset: {
8991
x: 0,
9092
y: 0,
91-
z: 1,
93+
z: AIR_GAP_OFFSET_FROM_TOP,
9294
},
93-
origin: 'bottom',
95+
origin: 'top',
9496
},
9597
wellName: 'A1',
9698
},
@@ -113,4 +115,45 @@ describe('airGapInWell', () => {
113115
},
114116
])
115117
})
118+
it('air gap after aspirate', () => {
119+
const args = {
120+
labwareId: DEST_LABWARE,
121+
wellName: 'A1',
122+
flowRate: 10,
123+
pipetteId: 'p10SingleId',
124+
volume: 10,
125+
type: 'aspirate' as AirGapInWellType,
126+
}
127+
128+
const result = airGapInWell(args, invariantContext, robotStateWithTip)
129+
const res = getSuccessResult(result)
130+
expect(res.commands).toEqual([
131+
{
132+
commandType: 'moveToWell',
133+
key: expect.any(String),
134+
params: {
135+
labwareId: 'destPlateId',
136+
pipetteId: 'p10SingleId',
137+
wellLocation: {
138+
offset: {
139+
x: 0,
140+
y: 0,
141+
z: AIR_GAP_OFFSET_FROM_TOP,
142+
},
143+
origin: 'top',
144+
},
145+
wellName: 'A1',
146+
},
147+
},
148+
{
149+
commandType: 'airGapInPlace',
150+
key: expect.any(String),
151+
params: {
152+
flowRate: 10,
153+
pipetteId: 'p10SingleId',
154+
volume: 10,
155+
},
156+
},
157+
])
158+
})
116159
})

step-generation/src/__tests__/consolidate.test.ts

+26-26
Original file line numberDiff line numberDiff line change
@@ -1288,11 +1288,11 @@ describe('consolidate single-channel', () => {
12881288
labwareId: 'sourcePlateId',
12891289
wellName: 'A1',
12901290
wellLocation: {
1291-
origin: 'bottom',
1291+
origin: 'top',
12921292
offset: {
12931293
x: 0,
12941294
y: 0,
1295-
z: 11.54,
1295+
z: 1,
12961296
},
12971297
},
12981298
},
@@ -1382,11 +1382,11 @@ describe('consolidate single-channel', () => {
13821382
labwareId: 'sourcePlateId',
13831383
wellName: 'A2',
13841384
wellLocation: {
1385-
origin: 'bottom',
1385+
origin: 'top',
13861386
offset: {
13871387
x: 0,
13881388
y: 0,
1389-
z: 11.54,
1389+
z: 1,
13901390
},
13911391
},
13921392
},
@@ -1648,11 +1648,11 @@ describe('consolidate single-channel', () => {
16481648
labwareId: 'sourcePlateId',
16491649
wellName: 'A3',
16501650
wellLocation: {
1651-
origin: 'bottom',
1651+
origin: 'top',
16521652
offset: {
16531653
x: 0,
16541654
y: 0,
1655-
z: 11.54,
1655+
z: 1,
16561656
},
16571657
},
16581658
},
@@ -1797,11 +1797,11 @@ describe('consolidate single-channel', () => {
17971797
labwareId: 'destPlateId',
17981798
wellName: 'B1',
17991799
wellLocation: {
1800-
origin: 'bottom',
1800+
origin: 'top',
18011801
offset: {
18021802
x: 0,
18031803
y: 0,
1804-
z: 11.54,
1804+
z: 1,
18051805
},
18061806
},
18071807
},
@@ -1995,11 +1995,11 @@ describe('consolidate single-channel', () => {
19951995
labwareId: 'sourcePlateId',
19961996
wellName: 'A1',
19971997
wellLocation: {
1998-
origin: 'bottom',
1998+
origin: 'top',
19991999
offset: {
20002000
x: 0,
20012001
y: 0,
2002-
z: 11.54,
2002+
z: 1,
20032003
},
20042004
},
20052005
},
@@ -2088,11 +2088,11 @@ describe('consolidate single-channel', () => {
20882088
labwareId: 'sourcePlateId',
20892089
wellName: 'A2',
20902090
wellLocation: {
2091-
origin: 'bottom',
2091+
origin: 'top',
20922092
offset: {
20932093
x: 0,
20942094
y: 0,
2095-
z: 11.54,
2095+
z: 1,
20962096
},
20972097
},
20982098
},
@@ -2369,11 +2369,11 @@ describe('consolidate single-channel', () => {
23692369
labwareId: 'sourcePlateId',
23702370
wellName: 'A3',
23712371
wellLocation: {
2372-
origin: 'bottom',
2372+
origin: 'top',
23732373
offset: {
23742374
x: 0,
23752375
y: 0,
2376-
z: 11.54,
2376+
z: 1,
23772377
},
23782378
},
23792379
},
@@ -2533,11 +2533,11 @@ describe('consolidate single-channel', () => {
25332533
labwareId: 'destPlateId',
25342534
wellName: 'B1',
25352535
wellLocation: {
2536-
origin: 'bottom',
2536+
origin: 'top',
25372537
offset: {
25382538
x: 0,
25392539
y: 0,
2540-
z: 11.54,
2540+
z: 1,
25412541
},
25422542
},
25432543
},
@@ -2752,11 +2752,11 @@ describe('consolidate single-channel', () => {
27522752
labwareId: 'sourcePlateId',
27532753
wellName: 'A1',
27542754
wellLocation: {
2755-
origin: 'bottom',
2755+
origin: 'top',
27562756
offset: {
27572757
x: 0,
27582758
y: 0,
2759-
z: 11.54,
2759+
z: 1,
27602760
},
27612761
},
27622762
},
@@ -2845,11 +2845,11 @@ describe('consolidate single-channel', () => {
28452845
labwareId: 'sourcePlateId',
28462846
wellName: 'A2',
28472847
wellLocation: {
2848-
origin: 'bottom',
2848+
origin: 'top',
28492849
offset: {
28502850
x: 0,
28512851
y: 0,
2852-
z: 11.54,
2852+
z: 1,
28532853
},
28542854
},
28552855
},
@@ -3010,11 +3010,11 @@ describe('consolidate single-channel', () => {
30103010
labwareId: 'destPlateId',
30113011
wellName: 'B1',
30123012
wellLocation: {
3013-
origin: 'bottom',
3013+
origin: 'top',
30143014
offset: {
30153015
x: 0,
30163016
y: 0,
3017-
z: 11.54,
3017+
z: 1,
30183018
},
30193019
},
30203020
},
@@ -3177,11 +3177,11 @@ describe('consolidate single-channel', () => {
31773177
labwareId: 'sourcePlateId',
31783178
wellName: 'A3',
31793179
wellLocation: {
3180-
origin: 'bottom',
3180+
origin: 'top',
31813181
offset: {
31823182
x: 0,
31833183
y: 0,
3184-
z: 11.54,
3184+
z: 1,
31853185
},
31863186
},
31873187
},
@@ -3342,11 +3342,11 @@ describe('consolidate single-channel', () => {
33423342
labwareId: 'destPlateId',
33433343
wellName: 'B1',
33443344
wellLocation: {
3345-
origin: 'bottom',
3345+
origin: 'top',
33463346
offset: {
33473347
x: 0,
33483348
y: 0,
3349-
z: 11.54,
3349+
z: 1,
33503350
},
33513351
},
33523352
},

0 commit comments

Comments
 (0)