Skip to content

[star] [vantage] flags for skipping setting up modules #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 9 additions & 6 deletions pylabrobot/liquid_handling/backends/hamilton/STAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1265,22 +1268,22 @@ 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=
int(self._traversal_height * 10))

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))

Expand Down
2 changes: 1 addition & 1 deletion pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 11 additions & 12 deletions pylabrobot/liquid_handling/backends/hamilton/vantage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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.
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading