Skip to content

Commit 945f6bc

Browse files
authored
async setup of STAR components (#663)
1 parent aec283f commit 945f6bc

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import datetime
23
import enum
34
import functools
@@ -1381,33 +1382,40 @@ async def setup(
13811382

13821383
await self.pre_initialize_instrument()
13831384

1384-
if not initialized or any(tip_presences):
1385-
await self.initialize_pip()
1385+
async def pip():
1386+
if not initialized or any(tip_presences):
1387+
await self.initialize_pip()
13861388

1387-
if self.autoload_installed and not skip_autoload:
1388-
autoload_initialized = await self.request_autoload_initialization_status()
1389-
if not autoload_initialized:
1390-
await self.initialize_autoload()
1389+
async def autoload():
1390+
if self.autoload_installed and not skip_autoload:
1391+
autoload_initialized = await self.request_autoload_initialization_status()
1392+
if not autoload_initialized:
1393+
await self.initialize_autoload()
13911394

1392-
await self.park_autoload()
1393-
1394-
if self.iswap_installed and not skip_iswap:
1395-
iswap_initialized = await self.request_iswap_initialization_status()
1396-
if not iswap_initialized:
1397-
await self.initialize_iswap()
1395+
await self.park_autoload()
13981396

1399-
await self.park_iswap(
1400-
minimum_traverse_height_at_beginning_of_a_command=int(self._iswap_traversal_height * 10)
1401-
)
1397+
async def iswap():
1398+
if self.iswap_installed and not skip_iswap:
1399+
iswap_initialized = await self.request_iswap_initialization_status()
1400+
if not iswap_initialized:
1401+
await self.initialize_iswap()
14021402

1403-
if self.core96_head_installed and not skip_core96_head:
1404-
core96_head_initialized = await self.request_core_96_head_initialization_status()
1405-
if not core96_head_initialized:
1406-
await self.initialize_core_96_head(
1407-
trash96=self.deck.get_trash_area96(),
1408-
z_position_at_the_command_end=self._channel_traversal_height,
1403+
await self.park_iswap(
1404+
minimum_traverse_height_at_beginning_of_a_command=int(self._iswap_traversal_height * 10)
14091405
)
14101406

1407+
async def core96_head():
1408+
if self.core96_head_installed and not skip_core96_head:
1409+
core96_head_initialized = await self.request_core_96_head_initialization_status()
1410+
if not core96_head_initialized:
1411+
await self.initialize_core_96_head(
1412+
trash96=self.deck.get_trash_area96(),
1413+
z_position_at_the_command_end=self._channel_traversal_height,
1414+
)
1415+
1416+
await pip()
1417+
await asyncio.gather(autoload(), iswap(), core96_head())
1418+
14111419
# After setup, STAR will have thrown out anything mounted on the pipetting channels, including
14121420
# the core grippers.
14131421
self._core_parked = True

0 commit comments

Comments
 (0)