From 2491a74458c0d5a362cd15cbc9ac892d340a7d62 Mon Sep 17 00:00:00 2001 From: mattloose Date: Wed, 25 Feb 2026 12:22:20 +0000 Subject: [PATCH 1/2] Catching pause state --- src/readfish/_read_until_client.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/readfish/_read_until_client.py b/src/readfish/_read_until_client.py index f5a5521..3b4c1c0 100644 --- a/src/readfish/_read_until_client.py +++ b/src/readfish/_read_until_client.py @@ -14,12 +14,17 @@ from readfish._loggers import setup_logger from grpc import RpcError -# Check against these states to determine if Minknow is under the impression -# The run has fully begun and readfish can be started +# Check against these states to determine if MinKNOW still considers the run +# active enough for readfish to remain connected. ACCEPTABLE_ACQUISITION_STATES = { AcquisitionState.ACQUISITION_RUNNING, AcquisitionState.ACQUISITION_STARTING, } +# Some MinKNOW versions expose explicit pause states. Treat them as non-terminal +# so readfish waits for sequencing to resume instead of disconnecting. +for _state_name in ("ACQUISITION_PAUSING", "ACQUISITION_PAUSED"): + if hasattr(AcquisitionState, _state_name): + ACCEPTABLE_ACQUISITION_STATES.add(getattr(AcquisitionState, _state_name)) # Any but these two states suggest the run has stopped ACCEPTABLE_PROTOCOL_STATES = { protocol_service.PROTOCOL_RUNNING, From 6357a64bad1dde6c0d3741f94453109e0d2cb661 Mon Sep 17 00:00:00 2001 From: mattloose Date: Wed, 25 Feb 2026 13:25:27 +0000 Subject: [PATCH 2/2] Addressing failed test --- src/readfish/_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/readfish/_utils.py b/src/readfish/_utils.py index 6792952..d454ec7 100644 --- a/src/readfish/_utils.py +++ b/src/readfish/_utils.py @@ -242,9 +242,9 @@ def get_flowcell_array(flowcell_size: int) -> npt.ArrayLike: Traceback (most recent call last): ... ValueError: flowcell_size is not recognised - >>> get_flowcell_array(126)[9][-1] + >>> int(get_flowcell_array(126)[9][-1]) 0 - >>> get_flowcell_array(512)[15][-1] + >>> int(get_flowcell_array(512)[15][-1]) 1 """