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

MRG: upgrade sig overlap and sig subtract to load more than JSON signatures #3153

Merged
merged 10 commits into from
Jun 4, 2024

Conversation

ctb
Copy link
Contributor

@ctb ctb commented May 12, 2024

Fix sig overlap and sig subtract to take more than just JSON signatures.

Also, adds a function sourmash_args.load_one_signature that I think should (eventually) replace the now-deprecated sourmash.signature.load_one_signature. This will be the topic of a new PR - for now, I think it's a nice quick fix!

Fixes #3136

Related issues:

TODO:

  • test uncovered code
  • do a bit more of a search and digest of related issues to see if there's other low hanging fruit

Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.65%. Comparing base (fabe76a) to head (6217360).

Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #3153      +/-   ##
==========================================
+ Coverage   86.64%   86.65%   +0.01%     
==========================================
  Files         136      136              
  Lines       15807    15821      +14     
  Branches     2713     2713              
==========================================
+ Hits        13696    13710      +14     
  Misses       1801     1801              
  Partials      310      310              
Flag Coverage Δ
hypothesis-py 25.30% <4.76%> (-0.02%) ⬇️
python 92.33% <100.00%> (+<0.01%) ⬆️
rust 62.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ctb ctb changed the title WIP: upgrade sig overlap and sig subtract MRG: upgrade sig overlap and sig subtract May 13, 2024
@ctb
Copy link
Contributor Author

ctb commented May 13, 2024

Ready for review @sourmash-bio/devs

@ctb ctb changed the title MRG: upgrade sig overlap and sig subtract MRG: upgrade sig overlap and sig subtract to load more than JSON signatures May 14, 2024
@ctb
Copy link
Contributor Author

ctb commented May 23, 2024

@ccbaumler @AnneliektH would either of you be able to look at this and (potentially) approve it? lmk if you don't have review privileges.

@ctb ctb enabled auto-merge (squash) May 23, 2024 13:49
Copy link
Contributor

@bluegenes bluegenes left a comment

Choose a reason for hiding this comment

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

lgtm!

@ctb ctb disabled auto-merge June 4, 2024 18:03
@ctb ctb merged commit 2542c69 into latest Jun 4, 2024
39 of 40 checks passed
@ctb ctb deleted the upgrade_sig_cmds branch June 4, 2024 18:03
ctb added a commit that referenced this pull request Jun 4, 2024
Note: PR into #3153

Tackles some signature loading and saving cleanup throughout the
codebase. Most changes are in the tests, and this is a significant
cleanup of the test code!

Fixes #1062.

---

Goals:
* deprecate external use of `sourmash.signature` load/save functions,
because they are JSON-specific and inflexible.
* simplify and standardize signature load/save function usage during
tests;
* get rid of deprecation messages during tests;

In brief,

* rename `sourmash.signature.load_signatures` to
`load_signatures_from_json`;
* rename `sourmash.signature.load_one_signature` to
`load_one_signature_from_json`;
* rename `sourmash.signature.save_signatures` to
`save_signatures_to_json`;
* deprecate `sourmash.save_signatures` and `sourmash.load_one_signature`
for 5.0 (joining `load_signatures`, which was already deprecated);
* reduce/eliminate deprecations by transitioning internal test code to
use these three functions directly from `sourmash.signature` instead of
from the top-level sourmash import.
* **bonus**: eliminate zipfile UserWarning around overwriting files,
which causes lots of warnings when running tests.

---

Done:
- [x] in sourmash.signature submodule, rename `load_signatures` to
`load_signatures_from_json`, `load_one_signature` to
`load_one_signatures_from_json`, and `save_signatures` to
`save_signatures_to_json`; make tests pass.
- [x] deprecate `sourmash.load_one_signature` and
`sourmash.save_signatures`.
- [x] catch zipfile UserWarning for duplicate filenames in
ZipStorage.save

TODO:
- [x] transition internal sourmash code+tests away from deprecated
functions
- [ ] create issue around changing API documentation prior to 5.0;

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

sig overlap and sig subtract should be upgraded to support more than JSON sigs
2 participants