Skip to content

Commit 48ac4e6

Browse files
feat(api): return location sequences from commands (#17435)
By adding all the locations of a labware used in a command that establishes or changes the position of a labware, we can free the client from having to accumulate all previous such commands to display a single such command. These locations are shown as location sequences. These are lists of heterogenous unions keyed by `kind`. The kinds mostly correspond to the kinds of locations that the engine already uses - they're different types because they have the `kind` key so you can tell them apart when serialized instead of just via python isinstance checks. All these sequences end in either an `OnCutoutFixtureLocation` which lists a cutout id and possible cutout fixtures; or a `NotOnDeckLocation` that specifies `OFF_DECK` or system. Different robots have different kinds of sequences; on the OT-2, modules are loaded on deck slots, and so a labware on a module would have `[OnModule, OnAddressableArea, OnCutoutFixture]` while on the Flex, modules are loaded on cutout fixtures and a labware on a module would have `[OnAdressableArea, OnModule, OnCutoutFixture]` (having the `OnModule` there lets us have the module ID; it is not technically necessary). There are some command implementations that are straightforward, and some that are charmingly quirky. - `loadLabware`, `reloadLabware`, `loadLid` all just return the location of the newly added labware. Simple, clean, wondrous - `loadLidStack` creates a lid stack object and returns its location, and also creates N lid objects and returns all of _their_ locations, which is done in its own array that is guaranteed to have the same ordering as all the lid ids so we can keep the types of the locations consistent across commands and also avoid altering already-existing result elements - `moveLabware` needs an origin and a destination location, so it has them. In fact, one destination location isn't enough. When we move labware to a trash location, we need to encode both (1) which trash location it was and (2) that it is a trash location. After the command, the position of the labware is `OFF_DECK` (because it went into the trash), after all. So we get both `immediateDestinationLocationSequence` (which in this scenario would be the addressable area of the trash) and `eventualDestinationLocationSequence` (which in this scenario would be off deck). If the two are the same, then the two are the same - the stacker `store` and `retrieve` commands have info that isn't really actually useful right now, but it will be soon, so let's carve out some space for them. For now the labware just bounces back and forth between the module/off deck and the module/stacker staging slot. ## to come out of draft - [x] ts bindings - [x] stacker store and retrieve - ~[ ] add "what is the old and new state of the locations named in the command" to these values~ not going to do that ^ in this pr just so we can get it merged --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: sfoster1 <[email protected]>
1 parent 455774e commit 48ac4e6

File tree

203 files changed

+86188
-2826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+86188
-2826
lines changed

analyses-snapshot-testing/tests/__snapshots__/analyses_snapshot_test/test_analysis_snapshot[00574c503f][pl_BacteriaInoculation_Flex_6plates].json

Lines changed: 1666 additions & 52 deletions
Large diffs are not rendered by default.

analyses-snapshot-testing/tests/__snapshots__/analyses_snapshot_test/test_analysis_snapshot[01255c3f3b][pl_Flex_Protein_Digestion_Protocol].json

Lines changed: 204 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,20 @@
101101
}
102102
}
103103
},
104-
"labwareId": "UUID"
104+
"labwareId": "UUID",
105+
"locationSequence": [
106+
{
107+
"addressableAreaName": "C1",
108+
"kind": "onAddressableArea"
109+
},
110+
{
111+
"cutoutId": "cutoutC1",
112+
"kind": "onCutoutFixture",
113+
"possibleCutoutFixtureIds": [
114+
"singleLeftSlot"
115+
]
116+
}
117+
]
105118
},
106119
"startedAt": "TIMESTAMP",
107120
"status": "succeeded"
@@ -170,7 +183,20 @@
170183
"version": 1,
171184
"wells": {}
172185
},
173-
"labwareId": "UUID"
186+
"labwareId": "UUID",
187+
"locationSequence": [
188+
{
189+
"addressableAreaName": "A1",
190+
"kind": "onAddressableArea"
191+
},
192+
{
193+
"cutoutId": "cutoutA1",
194+
"kind": "onCutoutFixture",
195+
"possibleCutoutFixtureIds": [
196+
"singleLeftSlot"
197+
]
198+
}
199+
]
174200
},
175201
"startedAt": "TIMESTAMP",
176202
"status": "succeeded"
@@ -1328,7 +1354,24 @@
13281354
}
13291355
}
13301356
},
1331-
"labwareId": "UUID"
1357+
"labwareId": "UUID",
1358+
"locationSequence": [
1359+
{
1360+
"kind": "onLabware",
1361+
"labwareId": "UUID"
1362+
},
1363+
{
1364+
"addressableAreaName": "A1",
1365+
"kind": "onAddressableArea"
1366+
},
1367+
{
1368+
"cutoutId": "cutoutA1",
1369+
"kind": "onCutoutFixture",
1370+
"possibleCutoutFixtureIds": [
1371+
"singleLeftSlot"
1372+
]
1373+
}
1374+
]
13321375
},
13331376
"startedAt": "TIMESTAMP",
13341377
"status": "succeeded"
@@ -1397,7 +1440,20 @@
13971440
"version": 1,
13981441
"wells": {}
13991442
},
1400-
"labwareId": "UUID"
1443+
"labwareId": "UUID",
1444+
"locationSequence": [
1445+
{
1446+
"addressableAreaName": "A2",
1447+
"kind": "onAddressableArea"
1448+
},
1449+
{
1450+
"cutoutId": "cutoutA2",
1451+
"kind": "onCutoutFixture",
1452+
"possibleCutoutFixtureIds": [
1453+
"singleCenterSlot"
1454+
]
1455+
}
1456+
]
14011457
},
14021458
"startedAt": "TIMESTAMP",
14031459
"status": "succeeded"
@@ -2555,7 +2611,24 @@
25552611
}
25562612
}
25572613
},
2558-
"labwareId": "UUID"
2614+
"labwareId": "UUID",
2615+
"locationSequence": [
2616+
{
2617+
"kind": "onLabware",
2618+
"labwareId": "UUID"
2619+
},
2620+
{
2621+
"addressableAreaName": "A2",
2622+
"kind": "onAddressableArea"
2623+
},
2624+
{
2625+
"cutoutId": "cutoutA2",
2626+
"kind": "onCutoutFixture",
2627+
"possibleCutoutFixtureIds": [
2628+
"singleCenterSlot"
2629+
]
2630+
}
2631+
]
25592632
},
25602633
"startedAt": "TIMESTAMP",
25612634
"status": "succeeded"
@@ -2624,7 +2697,20 @@
26242697
"version": 1,
26252698
"wells": {}
26262699
},
2627-
"labwareId": "UUID"
2700+
"labwareId": "UUID",
2701+
"locationSequence": [
2702+
{
2703+
"addressableAreaName": "B1",
2704+
"kind": "onAddressableArea"
2705+
},
2706+
{
2707+
"cutoutId": "cutoutB1",
2708+
"kind": "onCutoutFixture",
2709+
"possibleCutoutFixtureIds": [
2710+
"singleLeftSlot"
2711+
]
2712+
}
2713+
]
26282714
},
26292715
"startedAt": "TIMESTAMP",
26302716
"status": "succeeded"
@@ -3782,7 +3868,24 @@
37823868
}
37833869
}
37843870
},
3785-
"labwareId": "UUID"
3871+
"labwareId": "UUID",
3872+
"locationSequence": [
3873+
{
3874+
"kind": "onLabware",
3875+
"labwareId": "UUID"
3876+
},
3877+
{
3878+
"addressableAreaName": "B1",
3879+
"kind": "onAddressableArea"
3880+
},
3881+
{
3882+
"cutoutId": "cutoutB1",
3883+
"kind": "onCutoutFixture",
3884+
"possibleCutoutFixtureIds": [
3885+
"singleLeftSlot"
3886+
]
3887+
}
3888+
]
37863889
},
37873890
"startedAt": "TIMESTAMP",
37883891
"status": "succeeded"
@@ -3851,7 +3954,20 @@
38513954
"version": 1,
38523955
"wells": {}
38533956
},
3854-
"labwareId": "UUID"
3957+
"labwareId": "UUID",
3958+
"locationSequence": [
3959+
{
3960+
"addressableAreaName": "B2",
3961+
"kind": "onAddressableArea"
3962+
},
3963+
{
3964+
"cutoutId": "cutoutB2",
3965+
"kind": "onCutoutFixture",
3966+
"possibleCutoutFixtureIds": [
3967+
"singleCenterSlot"
3968+
]
3969+
}
3970+
]
38553971
},
38563972
"startedAt": "TIMESTAMP",
38573973
"status": "succeeded"
@@ -5009,7 +5125,24 @@
50095125
}
50105126
}
50115127
},
5012-
"labwareId": "UUID"
5128+
"labwareId": "UUID",
5129+
"locationSequence": [
5130+
{
5131+
"kind": "onLabware",
5132+
"labwareId": "UUID"
5133+
},
5134+
{
5135+
"addressableAreaName": "B2",
5136+
"kind": "onAddressableArea"
5137+
},
5138+
{
5139+
"cutoutId": "cutoutB2",
5140+
"kind": "onCutoutFixture",
5141+
"possibleCutoutFixtureIds": [
5142+
"singleCenterSlot"
5143+
]
5144+
}
5145+
]
50135146
},
50145147
"startedAt": "TIMESTAMP",
50155148
"status": "succeeded"
@@ -6276,7 +6409,20 @@
62766409
}
62776410
}
62786411
},
6279-
"labwareId": "UUID"
6412+
"labwareId": "UUID",
6413+
"locationSequence": [
6414+
{
6415+
"addressableAreaName": "C2",
6416+
"kind": "onAddressableArea"
6417+
},
6418+
{
6419+
"cutoutId": "cutoutC2",
6420+
"kind": "onCutoutFixture",
6421+
"possibleCutoutFixtureIds": [
6422+
"singleCenterSlot"
6423+
]
6424+
}
6425+
]
62806426
},
62816427
"startedAt": "TIMESTAMP",
62826428
"status": "succeeded"
@@ -7939,7 +8085,22 @@
79398085
}
79408086
}
79418087
},
7942-
"labwareId": "UUID"
8088+
"labwareId": "UUID",
8089+
"locationSequence": [
8090+
{
8091+
"addressableAreaName": "C3",
8092+
"kind": "onAddressableArea"
8093+
},
8094+
{
8095+
"cutoutId": "cutoutC3",
8096+
"kind": "onCutoutFixture",
8097+
"possibleCutoutFixtureIds": [
8098+
"flexStackerModuleV1",
8099+
"singleRightSlot",
8100+
"stagingAreaRightSlot"
8101+
]
8102+
}
8103+
]
79438104
},
79448105
"startedAt": "TIMESTAMP",
79458106
"status": "succeeded"
@@ -9602,7 +9763,20 @@
96029763
}
96039764
}
96049765
},
9605-
"labwareId": "UUID"
9766+
"labwareId": "UUID",
9767+
"locationSequence": [
9768+
{
9769+
"addressableAreaName": "D2",
9770+
"kind": "onAddressableArea"
9771+
},
9772+
{
9773+
"cutoutId": "cutoutD2",
9774+
"kind": "onCutoutFixture",
9775+
"possibleCutoutFixtureIds": [
9776+
"singleCenterSlot"
9777+
]
9778+
}
9779+
]
96069780
},
96079781
"startedAt": "TIMESTAMP",
96089782
"status": "succeeded"
@@ -11265,7 +11439,24 @@
1126511439
}
1126611440
}
1126711441
},
11268-
"labwareId": "UUID"
11442+
"labwareId": "UUID",
11443+
"locationSequence": [
11444+
{
11445+
"addressableAreaName": "D3",
11446+
"kind": "onAddressableArea"
11447+
},
11448+
{
11449+
"cutoutId": "cutoutD3",
11450+
"kind": "onCutoutFixture",
11451+
"possibleCutoutFixtureIds": [
11452+
"flexStackerModuleV1",
11453+
"flexStackerModuleV1WithWasteChuteRightAdapterCovered",
11454+
"flexStackerModuleV1WithWasteChuteRightAdapterNoCover",
11455+
"singleRightSlot",
11456+
"stagingAreaRightSlot"
11457+
]
11458+
}
11459+
]
1126911460
},
1127011461
"startedAt": "TIMESTAMP",
1127111462
"status": "succeeded"

0 commit comments

Comments
 (0)