Skip to content

Commit f9b63bc

Browse files
authored
feat(api): Bump Flex Stacker PAPI to 2.25 and update the stacker protocols to match. (#18773)
1 parent b1c15cc commit f9b63bc

File tree

6 files changed

+35
-67
lines changed

6 files changed

+35
-67
lines changed

abr-testing/abr_testing/protocols/test_protocols/IDT xGen 96ch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
requirements = {
2020
"robotType": "Flex",
21-
"apiLevel": "2.23",
21+
"apiLevel": "2.25",
2222
}
2323

2424

abr-testing/abr_testing/protocols/test_protocols/Illumina RNA all parts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
requirements = {
2323
"robotType": "Flex",
24-
"apiLevel": "2.23",
24+
"apiLevel": "2.25",
2525
}
2626

2727

api/src/opentrons/protocol_api/module_contexts.py

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,18 +1118,18 @@ class FlexStackerContext(ModuleContext):
11181118
It should not be instantiated directly; instead, it should be
11191119
created through :py:meth:`.ProtocolContext.load_module`.
11201120
1121-
.. versionadded:: 2.23
1121+
.. versionadded:: 2.25
11221122
"""
11231123

11241124
_core: FlexStackerCore
11251125

11261126
@property
1127-
@requires_version(2, 23)
1127+
@requires_version(2, 25)
11281128
def serial_number(self) -> str:
11291129
"""Get the module's unique hardware serial number."""
11301130
return self._core.get_serial_number()
11311131

1132-
@requires_version(2, 23)
1132+
@requires_version(2, 25)
11331133
def retrieve(self) -> Labware:
11341134
"""Retrieve a labware from the Flex Stacker and place it on the shuttle.
11351135
@@ -1147,7 +1147,7 @@ def retrieve(self) -> Labware:
11471147
),
11481148
)
11491149

1150-
@requires_version(2, 23)
1150+
@requires_version(2, 25)
11511151
def store(self) -> None:
11521152
"""Move the labware currently on the Flex Stacker shuttle into the Flex Stacker."""
11531153
self._core.store()
@@ -1167,7 +1167,7 @@ def _convert() -> Iterator[Labware]:
11671167

11681168
return list(_convert())
11691169

1170-
@requires_version(2, 24)
1170+
@requires_version(2, 25)
11711171
def get_max_storable_labware_from_list(
11721172
self,
11731173
labware: list[Labware],
@@ -1203,7 +1203,7 @@ def get_max_storable_labware_from_list(
12031203
),
12041204
)
12051205

1206-
@requires_version(2, 24)
1206+
@requires_version(2, 25)
12071207
def get_current_storable_labware_from_list(
12081208
self, labware: list[Labware]
12091209
) -> list[Labware]:
@@ -1224,7 +1224,7 @@ def get_current_storable_labware_from_list(
12241224
)
12251225
)
12261226

1227-
@requires_version(2, 24)
1227+
@requires_version(2, 25)
12281228
def get_max_storable_labware(self) -> int:
12291229
"""Get the number of labware that the Flex Stacker can store with its current stored labware configuration.
12301230
@@ -1234,7 +1234,7 @@ def get_max_storable_labware(self) -> int:
12341234
"""
12351235
return self._core.get_max_storable_labware()
12361236

1237-
@requires_version(2, 24)
1237+
@requires_version(2, 25)
12381238
def get_current_storable_labware(self) -> int:
12391239
"""Get the number of labware that the Flex Stacker currently has space for.
12401240
@@ -1243,7 +1243,7 @@ def get_current_storable_labware(self) -> int:
12431243
"""
12441244
return self._core.get_current_storable_labware()
12451245

1246-
@requires_version(2, 24)
1246+
@requires_version(2, 25)
12471247
def set_stored_labware_items(
12481248
self,
12491249
labware: list[Labware],
@@ -1293,7 +1293,7 @@ def set_stored_labware_items(
12931293
stacking_offset_z=stacking_offset_z,
12941294
)
12951295

1296-
@requires_version(2, 23)
1296+
@requires_version(2, 25)
12971297
def set_stored_labware(
12981298
self,
12991299
load_name: str,
@@ -1369,33 +1369,17 @@ def set_stored_labware(
13691369
stacking_offset_z=stacking_offset_z,
13701370
)
13711371

1372-
@requires_version(2, 23)
1372+
@requires_version(2, 25)
13731373
def fill(self, count: int | None = None, message: str | None = None) -> None:
13741374
"""Pause the protocol to add more labware to the Flex Stacker.
13751375
13761376
:param message: A message to display in the Opentrons App to note what kind of labware to add.
13771377
:param count: The amount of labware the Flex Stacker should hold after this command is executed.
13781378
If not specified, the Flex Stacker should be full after this command is executed.
13791379
"""
1380-
if self.api_version < APIVersion(2, 24):
1381-
# politeness: the order of the arguments changed in api 2.24. This wasn't released so it isn't
1382-
# a problem, but anybody using this probably would not like their protocols suddenly breaking
1383-
if isinstance(count, str):
1384-
checked_message = count
1385-
checked_count = message
1386-
elif (not isinstance(message, str)) and message is not None:
1387-
checked_count = message
1388-
checked_message = count
1389-
else:
1390-
checked_count = count
1391-
checked_message = message
1392-
else:
1393-
checked_count = count
1394-
checked_message = message
1395-
1396-
self._core.fill(checked_count, checked_message)
1380+
self._core.fill(count, message)
13971381

1398-
@requires_version(2, 24)
1382+
@requires_version(2, 25)
13991383
def fill_items(self, labware: list[Labware], message: str | None = None) -> None:
14001384
"""Pause the protocol to add a specific list of labware to the Flex Stacker.
14011385
@@ -1410,7 +1394,7 @@ def fill_items(self, labware: list[Labware], message: str | None = None) -> None
14101394
"""
14111395
self._core.fill_items(self._labware_to_cores(labware), message)
14121396

1413-
@requires_version(2, 23)
1397+
@requires_version(2, 25)
14141398
def empty(self, message: str | None = None) -> None:
14151399
"""Pause the protocol to remove labware from the Flex Stacker.
14161400
@@ -1421,7 +1405,7 @@ def empty(self, message: str | None = None) -> None:
14211405
message,
14221406
)
14231407

1424-
@requires_version(2, 24)
1408+
@requires_version(2, 25)
14251409
def get_stored_labware(self) -> list[Labware]:
14261410
"""Get the list of labware currently stored inside the stacker.
14271411

api/tests/opentrons/protocol_api/test_flex_stacker_context.py

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def subject(
7171

7272

7373
@pytest.mark.parametrize(
74-
"api_version", versions_at_or_above(from_version=APIVersion(2, 23))
74+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
7575
)
7676
def test_get_serial_number(
7777
decoy: Decoy, mock_core: FlexStackerCore, subject: FlexStackerContext
@@ -82,24 +82,8 @@ def test_get_serial_number(
8282
assert result == "12345"
8383

8484

85-
@pytest.mark.parametrize("api_version", [APIVersion(2, 23)])
8685
@pytest.mark.parametrize(
87-
"message,count", [("hello", 2), ("hello", None), (None, 2), (None, None)]
88-
)
89-
def test_fill_old_args(
90-
decoy: Decoy,
91-
mock_core: FlexStackerCore,
92-
subject: FlexStackerContext,
93-
message: str | None,
94-
count: int | None,
95-
) -> None:
96-
"""It should pass args to the core."""
97-
subject.fill(message, count) # type: ignore[arg-type]
98-
decoy.verify(mock_core.fill(count, message))
99-
100-
101-
@pytest.mark.parametrize(
102-
"api_version", versions_at_or_above(from_version=APIVersion(2, 23))
86+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
10387
)
10488
def test_fill(
10589
decoy: Decoy, mock_core: FlexStackerCore, subject: FlexStackerContext
@@ -110,7 +94,7 @@ def test_fill(
11094

11195

11296
@pytest.mark.parametrize(
113-
"api_version", versions_at_or_above(from_version=APIVersion(2, 23))
97+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
11498
)
11599
def test_empty(
116100
decoy: Decoy, mock_core: FlexStackerCore, subject: FlexStackerContext
@@ -121,7 +105,7 @@ def test_empty(
121105

122106

123107
@pytest.mark.parametrize(
124-
"api_version", versions_at_or_above(from_version=APIVersion(2, 23))
108+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
125109
)
126110
def test_set_stored_labware(
127111
decoy: Decoy, mock_core: FlexStackerCore, subject: FlexStackerContext
@@ -148,7 +132,7 @@ def test_set_stored_labware(
148132

149133

150134
@pytest.mark.parametrize(
151-
"api_version", versions_at_or_above(from_version=APIVersion(2, 24))
135+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
152136
)
153137
def test_get_max_storable_labware_from_list(
154138
decoy: Decoy,
@@ -168,7 +152,7 @@ def test_get_max_storable_labware_from_list(
168152
base_lw = [
169153
Labware(
170154
core=core,
171-
api_version=APIVersion(2, 24),
155+
api_version=APIVersion(2, 25),
172156
protocol_core=mock_protocol_core,
173157
core_map=subject._core_map,
174158
)
@@ -181,7 +165,7 @@ def test_get_max_storable_labware_from_list(
181165

182166

183167
@pytest.mark.parametrize(
184-
"api_version", versions_at_or_above(from_version=APIVersion(2, 24))
168+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
185169
)
186170
def test_get_current_storable_labware_from_list(
187171
decoy: Decoy,
@@ -201,7 +185,7 @@ def test_get_current_storable_labware_from_list(
201185
base_lw = [
202186
Labware(
203187
core=core,
204-
api_version=APIVersion(2, 24),
188+
api_version=APIVersion(2, 25),
205189
protocol_core=mock_protocol_core,
206190
core_map=subject._core_map,
207191
)
@@ -214,7 +198,7 @@ def test_get_current_storable_labware_from_list(
214198

215199

216200
@pytest.mark.parametrize(
217-
"api_version", versions_at_or_above(from_version=APIVersion(2, 24))
201+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
218202
)
219203
def test_get_max_storable_labware(
220204
decoy: Decoy,
@@ -227,7 +211,7 @@ def test_get_max_storable_labware(
227211

228212

229213
@pytest.mark.parametrize(
230-
"api_version", versions_at_or_above(from_version=APIVersion(2, 24))
214+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
231215
)
232216
def test_get_current_storable_labware(
233217
decoy: Decoy,
@@ -240,7 +224,7 @@ def test_get_current_storable_labware(
240224

241225

242226
@pytest.mark.parametrize(
243-
"api_version", versions_at_or_above(from_version=APIVersion(2, 24))
227+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
244228
)
245229
def test_get_stored_labware(
246230
decoy: Decoy,
@@ -260,7 +244,7 @@ def test_get_stored_labware(
260244
base_lw = [
261245
Labware(
262246
core=core,
263-
api_version=APIVersion(2, 24),
247+
api_version=APIVersion(2, 25),
264248
protocol_core=mock_protocol_core,
265249
core_map=subject._core_map,
266250
)
@@ -271,7 +255,7 @@ def test_get_stored_labware(
271255

272256

273257
@pytest.mark.parametrize(
274-
"api_version", versions_at_or_above(from_version=APIVersion(2, 24))
258+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
275259
)
276260
@pytest.mark.parametrize("message", ["hello", None])
277261
def test_fill_items(
@@ -291,7 +275,7 @@ def test_fill_items(
291275
base_lw = [
292276
Labware(
293277
core=core,
294-
api_version=APIVersion(2, 24),
278+
api_version=APIVersion(2, 25),
295279
protocol_core=mock_protocol_core,
296280
core_map=subject._core_map,
297281
)
@@ -302,7 +286,7 @@ def test_fill_items(
302286

303287

304288
@pytest.mark.parametrize(
305-
"api_version", versions_at_or_above(from_version=APIVersion(2, 24))
289+
"api_version", versions_at_or_above(from_version=APIVersion(2, 25))
306290
)
307291
def test_set_stored_labware_items(
308292
decoy: Decoy,
@@ -320,7 +304,7 @@ def test_set_stored_labware_items(
320304
base_lw = [
321305
Labware(
322306
core=core,
323-
api_version=APIVersion(2, 24),
307+
api_version=APIVersion(2, 25),
324308
protocol_core=mock_protocol_core,
325309
core_map=subject._core_map,
326310
)

hardware-testing/hardware_testing/modules/stacker_qc_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
requirements = {
1212
"robotType": "Flex",
13-
"apiLevel": "2.23",
13+
"apiLevel": "2.25",
1414
}
1515

1616

hardware-testing/hardware_testing/protocols/labware_stack_offset_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
requirements = {
1313
"robotType": "Flex",
14-
"apiLevel": "2.23",
14+
"apiLevel": "2.25",
1515
}
1616

1717

0 commit comments

Comments
 (0)