Closed ctb closed 3 weeks ago
Attention: Patch coverage is 85.71429%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 86.46%. Comparing base (
f707db4
) to head (e0726c8
). Report is 1 commits behind head on latest.
Files with missing lines | Patch % | Lines |
---|---|---|
src/core/src/storage/mod.rs | 85.71% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@luizirber @bluegenes thoughts welcome!
@luizirber bump!
🙏
This PR was originally about debugging https://github.com/sourmash-bio/sourmash_plugin_branchwater/pull/445, but that's going to require more work to fix properly. For now, I would like to nominate it for merge because sourmash fails silently in this situation, and that's Bad.
In brief, the main thing this PR does is panic with an
unimplemented!
whenFSStorage::load_sig
encounters more than oneSignature
in a JSON record.This PR also adds a bit of documentation to
InnerStorage
, per the bottom of this comment.The problem at hand: when loading a
SigStore
/Signature
from aStorage
, sourmash only loads the first one and ignores any others.https://github.com/sourmash-bio/sourmash/blob/26b50f3e3566006fd6356a4f8b4d47c5e381aeec/src/core/src/storage/mod.rs#L34-L38
This results from the concept of a
Signature
as containing one or more sketches; the history of this is described here, and it leads to some interesting silliness in the Python layer.The contrapositive is that, in Rust, a single
Signature
can include multiple sketches, e.g. with different ksizes. So this works fine for the wort case where we have a single.sig
file with k=21, k=31, k51.Note that the Python layer (and hence the entire sourmash CLI) fully supports multiple
Signature
s in JSON: this is well tested and well covered behavior. The branchwater plugin runs into it because it is using the Rust layer and the API is not fully fleshed out there.