Skip to content

Commit

Permalink
Change type on --wait-for-ready to int (#327)
Browse files Browse the repository at this point in the history
* Change type on --wait-for-ready to int

* Change default to 120 on arg,
remove default for `wait_for_minknow_folder` as it was confusing, and the `_cli_args` default is passed through
  • Loading branch information
Adoni5 authored Feb 2, 2024
1 parent e71578b commit 3fb5df7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/readfish/_cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@
(
"--wait-for-ready",
dict(
help="Timeout for the MinKNOW data folder to appear, and the device to report it is ready to start sequencing. Default 60 seconds.",
help="Timeout for the MinKNOW data folder to appear, and the device to report it is ready to start sequencing in seconds. (default: 120s).",
required=False,
default=60,
default=120,
type=int,
),
),
) + BASE_ARGS
6 changes: 4 additions & 2 deletions src/readfish/_read_until_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class RUClient(ReadUntilClient):
"""Subclasses ONTs read_until_api ReadUntilClient adding extra function that logs unblocks read_ids."""

def __init__(self, *args, **kwargs):
# Default to TIMEOUT in the event we are not starting from the CLI.
# If started from CLI args.wait-for-ready is used - also defaults to 120s
self.timeout = kwargs.pop("timeout", TIMEOUT)
super().__init__(*args, **kwargs)
# disable the read until client logger
Expand Down Expand Up @@ -170,10 +172,10 @@ def set_acquisition_state(self):
else:
raise SystemExit(1)

def wait_for_minknow_folder(self, timeout: int = TIMEOUT):
def wait_for_minknow_folder(self, timeout: int):
"""
Rather than messing about with permissions wait for MinKNOW to create the run
folder. If the folder doesn't appear after TIMEOUT seconds then write to the
folder. If the folder doesn't appear after timeout seconds then write to the
current working directory instead.
"""
seconds_waited = 0
Expand Down

0 comments on commit 3fb5df7

Please sign in to comment.