From 3fb5df79d5149b67ee204f65809b58794fbfc8ff Mon Sep 17 00:00:00 2001 From: Adoni5 Date: Fri, 2 Feb 2024 09:49:28 +0000 Subject: [PATCH] Change type on --wait-for-ready to int (#327) * 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 --- src/readfish/_cli_args.py | 5 +++-- src/readfish/_read_until_client.py | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/readfish/_cli_args.py b/src/readfish/_cli_args.py index cbfde3ff..2102afa0 100644 --- a/src/readfish/_cli_args.py +++ b/src/readfish/_cli_args.py @@ -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 diff --git a/src/readfish/_read_until_client.py b/src/readfish/_read_until_client.py index 91307389..d98fa139 100644 --- a/src/readfish/_read_until_client.py +++ b/src/readfish/_read_until_client.py @@ -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 @@ -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