Skip to content

Commit 6542154

Browse files
authored
[star] [vantage] flags for skipping setting up modules (#263)
1 parent fbb08be commit 6542154

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
7878
- `TemperatureControllerChatterboxBackend`
7979
- Add fluorescence reading to Cytation 5 (https://github.com/PyLabRobot/pylabrobot/pull/244)
8080
- Add `F.linear_tip_spot_generator` and `F.randomized_tip_spot_generator` for looping over tip spots, with caching (https://github.com/PyLabRobot/pylabrobot/pull/256)
81+
- Add `skip_autoload`, `skip_iswap`, and `skip_core96_head` flags to `STAR.setup` (https://github.com/PyLabRobot/pylabrobot/pull/263)
82+
- Add `skip_autoload`, `skip_iswap`, and `skip_core96_head` flags to `Vantage.setup` (https://github.com/PyLabRobot/pylabrobot/pull/263)
8183

8284
### Deprecated
8385

pylabrobot/liquid_handling/backends/hamilton/STAR.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -1215,10 +1215,13 @@ def _parse_response(self, resp: str, fmt: str) -> dict:
12151215
""" Parse a response from the machine. """
12161216
return parse_star_fw_string(resp, fmt)
12171217

1218-
async def setup(self):
1219-
""" setup
1218+
async def setup(self, skip_autoload=False, skip_iswap=False, skip_core96_head=False):
1219+
""" Creates a USB connection and finds read/write interfaces.
12201220
1221-
Creates a USB connection and finds read/write interfaces.
1221+
Args:
1222+
skip_autoload: if True, skip initializing the autoload module, if applicable.
1223+
skip_iswap: if True, skip initializing the iSWAP module, if applicable.
1224+
skip_core96_head: if True, skip initializing the CoRe 96 head module, if applicable.
12221225
"""
12231226

12241227
await super().setup()
@@ -1265,22 +1268,22 @@ async def setup(self):
12651268

12661269
if self.autoload_installed:
12671270
autoload_initialized = await self.request_autoload_initialization_status()
1268-
if not autoload_initialized:
1271+
if not autoload_initialized and not skip_autoload:
12691272
await self.initialize_autoload()
12701273

12711274
await self.park_autoload()
12721275

12731276
if self.iswap_installed:
12741277
iswap_initialized = await self.request_iswap_initialization_status()
1275-
if not iswap_initialized:
1278+
if not iswap_initialized and not skip_iswap:
12761279
await self.initialize_iswap()
12771280

12781281
await self.park_iswap(minimum_traverse_height_at_beginning_of_a_command=
12791282
int(self._traversal_height * 10))
12801283

12811284
if self.core96_head_installed:
12821285
core96_head_initialized = await self.request_core_96_head_initialization_status()
1283-
if not core96_head_initialized:
1286+
if not core96_head_initialized and not skip_core96_head:
12841287
await self.initialize_core_96_head(
12851288
z_position_at_the_command_end=int(self._traversal_height*10))
12861289

pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def __init__(self):
176176
super().__init__()
177177
self.commands = []
178178

179-
async def setup(self) -> None:
179+
async def setup(self) -> None: # type: ignore
180180
self._num_channels = 8
181181
self.iswap_installed = True
182182
self.core96_head_installed = True

pylabrobot/liquid_handling/backends/hamilton/vantage.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,9 @@ def _parse_response(self, resp: str, fmt: Dict[str, str]) -> dict:
376376
""" Parse a firmware response. """
377377
return parse_vantage_fw_string(resp, fmt)
378378

379-
async def setup(self):
380-
""" setup
381-
382-
Creates a USB connection and finds read/write interfaces.
383-
"""
379+
async def setup(
380+
self, skip_loading_cover: bool = False, skip_core96: bool = False, skip_ipg: bool = False):
381+
""" Creates a USB connection and finds read/write interfaces. """
384382

385383
await super().setup()
386384

@@ -407,11 +405,11 @@ async def setup(self):
407405
)
408406

409407
loading_cover_initialized = await self.loading_cover_request_initialization_status()
410-
if not loading_cover_initialized:
408+
if not loading_cover_initialized and not skip_loading_cover:
411409
await self.loading_cover_initialize()
412410

413411
core96_initialized = await self.core96_request_initialization_status()
414-
if not core96_initialized:
412+
if not core96_initialized and not skip_core96:
415413
await self.core96_initialize(
416414
x_position=7347, # TODO: get trash location from deck.
417415
y_position=2684, # TODO: get trash location from deck.
@@ -420,11 +418,12 @@ async def setup(self):
420418
end_z_deposit_position=2420,
421419
)
422420

423-
ipg_initialized = await self.ipg_request_initialization_status()
424-
if not ipg_initialized:
425-
await self.ipg_initialize()
426-
if not await self.ipg_get_parking_status():
427-
await self.ipg_park()
421+
if not skip_ipg:
422+
ipg_initialized = await self.ipg_request_initialization_status()
423+
if not ipg_initialized:
424+
await self.ipg_initialize()
425+
if not await self.ipg_get_parking_status():
426+
await self.ipg_park()
428427

429428
@property
430429
def num_channels(self) -> int:

pylabrobot/liquid_handling/backends/hamilton/vantage_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(self):
119119
super().__init__()
120120
self.commands = []
121121

122-
async def setup(self) -> None:
122+
async def setup(self) -> None: # type: ignore
123123
self.setup_finished = True
124124
self._num_channels = 8
125125
self.iswap_installed = True

0 commit comments

Comments
 (0)