diff --git a/CHANGELOG.md b/CHANGELOG.md index 668deaba36..c738a7e0a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - `TemperatureControllerChatterboxBackend` - Add fluorescence reading to Cytation 5 (https://github.com/PyLabRobot/pylabrobot/pull/244) - 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) +- Add `skip_autoload`, `skip_iswap`, and `skip_core96_head` flags to `STAR.setup` (https://github.com/PyLabRobot/pylabrobot/pull/263) +- Add `skip_autoload`, `skip_iswap`, and `skip_core96_head` flags to `Vantage.setup` (https://github.com/PyLabRobot/pylabrobot/pull/263) ### Deprecated diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR.py b/pylabrobot/liquid_handling/backends/hamilton/STAR.py index 505195d509..63cf32dc90 100644 --- a/pylabrobot/liquid_handling/backends/hamilton/STAR.py +++ b/pylabrobot/liquid_handling/backends/hamilton/STAR.py @@ -1215,10 +1215,13 @@ def _parse_response(self, resp: str, fmt: str) -> dict: """ Parse a response from the machine. """ return parse_star_fw_string(resp, fmt) - async def setup(self): - """ setup + async def setup(self, skip_autoload=False, skip_iswap=False, skip_core96_head=False): + """ Creates a USB connection and finds read/write interfaces. - Creates a USB connection and finds read/write interfaces. + Args: + skip_autoload: if True, skip initializing the autoload module, if applicable. + skip_iswap: if True, skip initializing the iSWAP module, if applicable. + skip_core96_head: if True, skip initializing the CoRe 96 head module, if applicable. """ await super().setup() @@ -1265,14 +1268,14 @@ async def setup(self): if self.autoload_installed: autoload_initialized = await self.request_autoload_initialization_status() - if not autoload_initialized: + if not autoload_initialized and not skip_autoload: await self.initialize_autoload() await self.park_autoload() if self.iswap_installed: iswap_initialized = await self.request_iswap_initialization_status() - if not iswap_initialized: + if not iswap_initialized and not skip_iswap: await self.initialize_iswap() await self.park_iswap(minimum_traverse_height_at_beginning_of_a_command= @@ -1280,7 +1283,7 @@ async def setup(self): if self.core96_head_installed: core96_head_initialized = await self.request_core_96_head_initialization_status() - if not core96_head_initialized: + if not core96_head_initialized and not skip_core96_head: await self.initialize_core_96_head( z_position_at_the_command_end=int(self._traversal_height*10)) diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py index 8a35469d36..7aa85285d7 100644 --- a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py +++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py @@ -176,7 +176,7 @@ def __init__(self): super().__init__() self.commands = [] - async def setup(self) -> None: + async def setup(self) -> None: # type: ignore self._num_channels = 8 self.iswap_installed = True self.core96_head_installed = True diff --git a/pylabrobot/liquid_handling/backends/hamilton/vantage.py b/pylabrobot/liquid_handling/backends/hamilton/vantage.py index 2f5cfad047..acb00476fa 100644 --- a/pylabrobot/liquid_handling/backends/hamilton/vantage.py +++ b/pylabrobot/liquid_handling/backends/hamilton/vantage.py @@ -376,11 +376,9 @@ def _parse_response(self, resp: str, fmt: Dict[str, str]) -> dict: """ Parse a firmware response. """ return parse_vantage_fw_string(resp, fmt) - async def setup(self): - """ setup - - Creates a USB connection and finds read/write interfaces. - """ + async def setup( + self, skip_loading_cover: bool = False, skip_core96: bool = False, skip_ipg: bool = False): + """ Creates a USB connection and finds read/write interfaces. """ await super().setup() @@ -407,11 +405,11 @@ async def setup(self): ) loading_cover_initialized = await self.loading_cover_request_initialization_status() - if not loading_cover_initialized: + if not loading_cover_initialized and not skip_loading_cover: await self.loading_cover_initialize() core96_initialized = await self.core96_request_initialization_status() - if not core96_initialized: + if not core96_initialized and not skip_core96: await self.core96_initialize( x_position=7347, # TODO: get trash location from deck. y_position=2684, # TODO: get trash location from deck. @@ -420,11 +418,12 @@ async def setup(self): end_z_deposit_position=2420, ) - ipg_initialized = await self.ipg_request_initialization_status() - if not ipg_initialized: - await self.ipg_initialize() - if not await self.ipg_get_parking_status(): - await self.ipg_park() + if not skip_ipg: + ipg_initialized = await self.ipg_request_initialization_status() + if not ipg_initialized: + await self.ipg_initialize() + if not await self.ipg_get_parking_status(): + await self.ipg_park() @property def num_channels(self) -> int: diff --git a/pylabrobot/liquid_handling/backends/hamilton/vantage_tests.py b/pylabrobot/liquid_handling/backends/hamilton/vantage_tests.py index 9552d6c1b2..8971625f22 100644 --- a/pylabrobot/liquid_handling/backends/hamilton/vantage_tests.py +++ b/pylabrobot/liquid_handling/backends/hamilton/vantage_tests.py @@ -119,7 +119,7 @@ def __init__(self): super().__init__() self.commands = [] - async def setup(self) -> None: + async def setup(self) -> None: # type: ignore self.setup_finished = True self._num_channels = 8 self.iswap_installed = True