Skip to content
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

Feature/check minknow #351

Merged
merged 13 commits into from
May 7, 2024

Conversation

mattloose
Copy link
Contributor

This pull request is to address #349 and is raised for discussiong.

@Adoni5
Copy link
Contributor

Adoni5 commented Apr 25, 2024

i love a good discussiong

@Adoni5
Copy link
Contributor

Adoni5 commented Apr 25, 2024

I'm going to change the target for this to feature/dorado

@Adoni5 Adoni5 changed the base branch from main to feature/update_pybasecall_client_lib April 25, 2024 08:11
@mattloose
Copy link
Contributor Author

i love a good discussiong

discussiong: noun
the action or process of talking about something in order to reach a conclusion which may take a very long time.

@mattloose
Copy link
Contributor Author

I'm going to change the target for this to feature/dorado

sorry - my bad - yep please do.

Copy link
Contributor

@Adoni5 Adoni5 left a comment

Choose a reason for hiding this comment

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

I've moved this to merge into the feature/dorado branch - as it has all the commits from that branch as part of it's history!

Is that correct?

src/readfish/plugins/dorado.py Outdated Show resolved Hide resolved
src/readfish/plugins/guppy.py Show resolved Hide resolved
src/readfish/__about__.py Outdated Show resolved Hide resolved
src/readfish/_utils.py Outdated Show resolved Hide resolved
src/readfish/_utils.py Outdated Show resolved Hide resolved
src/readfish/_utils.py Outdated Show resolved Hide resolved
src/readfish/_utils.py Outdated Show resolved Hide resolved
src/readfish/__compatability__.py Outdated Show resolved Hide resolved
@Adoni5
Copy link
Contributor

Adoni5 commented Apr 25, 2024

And I think you need to add packaging as a dependency!

@Adoni5
Copy link
Contributor

Adoni5 commented Apr 25, 2024

And I think you need to add packaging as a dependency!

I see that it is a dependency of the minknow_api, but maybe we could explicitly add it as a dependency anyway? Explicit is better than implicit after all

@mattloose
Copy link
Contributor Author

I've moved this to merge into the feature/dorado branch - as it has all the commits from that branch as part of it's history!

Is that correct?

probably

Adoni5 and others added 10 commits April 29, 2024 14:05
Base-caller compatibiity check
…longer raiseException when a version issue is encountered. This means that readfish will continue to function with future versions of minKNOW if compatible.
…longer raiseException when a version issue is encountered. This means that readfish will continue to function with future versions of minKNOW if compatible.
Prevents `KeyError` from being raised if `sample_rate`isn't listed as a `kwarg`
We now just check in `dorado.py` and warn if there is a mismatch
Copy link
Contributor

@Adoni5 Adoni5 left a comment

Choose a reason for hiding this comment

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

LGTM - @alexomics what say you?

Copy link
Contributor

@alexomics alexomics left a comment

Choose a reason for hiding this comment

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

Looks good! Only comments are:

  • the _compatibility.DIRECTION enum is a little opaque on first reading. It's not clear if that's saying upgrade readfish or MinKNOW.
  • check_compatibility looks hard to use in the code. Does it need to return a tuple/could the check be specifically for an actionable DIRECTION variant? E.g:
if (action := check_compat(...)) in (DIRECTION.UP, DIRECTION.DOWN):
    log(action)

@Adoni5
Copy link
Contributor

Adoni5 commented May 7, 2024

* the `_compatibility.DIRECTION` enum is a little opaque on first reading. It's not clear if that's saying upgrade readfish or MinKNOW.

class DIRECTION(Enum):
"""
Upgrade, downgrade or just right

Amazing stuff, I don't know how it could be clearer 👾
( Definitely thought that this docstring actually had contents)

* `check_compatibility` looks hard to use in the code. Does it need to return a tuple/could the check be specifically for an actionable `DIRECTION` variant? E.g:
if (action := check_compat(...)) in (DIRECTION.UP, DIRECTION.DOWN):
    log(action)

Yeah agreed, it should just return the Enum variant or None not the tuple, makes more sense 👍🏼

@alexomics
Copy link
Contributor

LGTM! 🚀

@Adoni5 Adoni5 merged commit 3482d59 into feature/update_pybasecall_client_lib May 7, 2024
@Adoni5 Adoni5 deleted the feature/check_minknow branch May 7, 2024 16:58
@mattloose
Copy link
Contributor Author

Much awesomeness.

Adoni5 added a commit that referenced this pull request May 9, 2024
* Introducing a dorado specific plugin which handles the change from ont_pyguppy_client_lib to ont_pybasecaller_client_lib

* minor code reformat

* Bump version

* Update Changelog

* Add `ont-pybasecall-client-lib` as a dependency under target `dorado`

* Add try/except on import helper functions and pyclient for basecaller
This is so pytest collections (The only time both are imported into the same interperter runtime) doesn't crash.
This requires all tests to only test one, so I've moved all tests to test dorado

* Move tests to test dorado rather than guppy plugin when validating
This is due to the fact that pytest imports all files, the only time that pyguppy-client-lib and pybasecall-client-lib are imported at the same time
In a real experiment, the plugin choice for base-caller imports the correct module and leaves the other one out of the interpreter runtime

* Remove dorado, guppy and _read_until_client from coverage reporting as we can't really cover them
They require things link a read_until_api or live base caller to properly test

* Introducing sample rate from minknow and catching sub_read issue.

* Updating documentation for dorado

* Feature/check minknow (#351)

* Initial validation of minknow version and guppy dorado versions

* MinKNOW compatibility check function
Base-caller compatibiity check

* edit insanely long string multiline string example of sub tags

* Local updates

* Error checking and minor corrections to address compatibility. We no longer raise RuntimeException when a version issue is encountered. This means that readfish will continue to function with future versions of minKNOW if compatible.

* Add default when popping `sample_rate` from guppy params
Prevents `KeyError` from being raised if `sample_rate`isn't listed as a `kwarg`

* Remove unused basecaller compatibilty function
We now just check in `dorado.py` and warn if there is a mismatch

* Correct docstring, add doctests

* Add more complete docstring to `DIRECTION` enum
Only return Enum variant from `check_compatibility`, not tuple of (bool, variant)

* Suggest opening an issue if a suitable version of readfish doesn't exist

---------

Co-authored-by: Adoni5 <roryjmunro1@gmail.com>

* Add __futures__ annotation for Py38 compatibility

* Deprecation warning on Guppy plugin

* Add check for Write permission on Dorado socket

---------

Co-authored-by: Adoni5 <roryjmunro1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants