Skip to content

Use .get instead of [] for strand classifcations#391

Merged
mattloose merged 4 commits into
mainfrom
Adoni5-patch-1
Jan 29, 2025
Merged

Use .get instead of [] for strand classifcations#391
mattloose merged 4 commits into
mainfrom
Adoni5-patch-1

Conversation

@Adoni5
Copy link
Copy Markdown
Contributor

@Adoni5 Adoni5 commented Jan 28, 2025

This gets around an uniformative KeyError raised when the run is not on. The missing Keys are not logged (and should be), I have created a separate issue (#390).

This will make the error that was raised in #389 far more explicit.

In the case that there is no run running, the output now is:

readfish unblock-all --device MS00000 --experiment-name deez
2025-01-28 09:51:02,872 readfish /Users/rory.munro/miniforge3/envs/py310/bin/readfish unblock-all --device MS00000 --experiment-name deez
2025-01-28 09:51:02,872 readfish chemistry=<Chemistry.SIMPLEX: 'simplex'>
2025-01-28 09:51:02,872 readfish command='unblock-all'
2025-01-28 09:51:02,872 readfish debug_log=True
2025-01-28 09:51:02,872 readfish device='MS00000'
2025-01-28 09:51:02,872 readfish dry_run=False
2025-01-28 09:51:02,872 readfish experiment_name='deez'
2025-01-28 09:51:02,872 readfish host='127.0.0.1'
2025-01-28 09:51:02,872 readfish log_file=None
2025-01-28 09:51:02,872 readfish log_format='%(asctime)s %(name)s %(message)s'
2025-01-28 09:51:02,872 readfish log_level='info'
2025-01-28 09:51:02,872 readfish max_unblock_read_length_seconds=5
2025-01-28 09:51:02,872 readfish port=None
2025-01-28 09:51:02,872 readfish throttle=0.4
2025-01-28 09:51:02,872 readfish unblock_duration=0.1
2025-01-28 09:51:02,872 readfish wait_for_ready=120
2025-01-28 09:51:02,872 readfish Version=2024.3.0
2025-01-28 09:51:02,930 readfish.unblock-all This readfish version (2024.3.0) is tested for compatibility with MinKNOW v6.0.0 to v6.0.0.
This version of minknow is 6.2.8.
If readfish fails please try to upgrade readfish.
If there isn't a newer version of readfish and readfish is failing, please open an issue:
    https://github.com/LooseLab/readfish/issues
2025-01-28 09:51:02,954 readfish._read_until_client Got RPC exception
<_InactiveRpcError of RPC that terminated with:
	status = StatusCode.FAILED_PRECONDITION
	details = "No protocol running"
	debug_error_string = "UNKNOWN:Error received from peer ipv4:127.0.0.1:8000 {grpc_message:"No protocol running", grpc_status:9, created_time:"2025-01-28T09:51:02.95323+00:00"}"
>
2025-01-28 09:51:02,954 readfish._read_until_client No protocol running, Run is currently not underway, Please check MinKNOW UI.

We still need to error log the missing strands before we release this change I think, in case that is changed upstream in MinKNOW.

This gets around an uniformative KeyError raised when the run is not on.
The missing Keys are not logged (and should be), I have created a separate issue for that.
@Adoni5 Adoni5 requested a review from mattloose January 28, 2025 10:45
@Adoni5 Adoni5 added the enhancement New feature or request label Jan 28, 2025
Copy link
Copy Markdown
Contributor

@mattloose mattloose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the message text more explicit w.r.t what has happened?

Comment thread src/readfish/read_until/base.py Outdated
Copy link
Copy Markdown
Contributor

@mattloose mattloose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh - spicy and nice.

@mattloose mattloose merged commit c6e52c7 into main Jan 29, 2025
@GZHoffie GZHoffie mentioned this pull request Jul 11, 2025
agrima2010 pushed a commit to agrima2010/readfish that referenced this pull request Apr 17, 2026
* .get instead of [] for strand classifcations

This gets around an uniformative KeyError raised when the run is not on.
The missing Keys are not logged (and should be), I have created a separate issue for that.

* Format for pre-commit

AAAAA

* Forgive me pre-commit for I have sinned

I should just do this in an IDE

* Edit default for missing classifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants