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] add selector framework to Index, and moltype property to MinHash object #936

Merged
merged 10 commits into from
Apr 19, 2020

Conversation

ctb
Copy link
Contributor

@ctb ctb commented Apr 6, 2020

When working on #809 I decided to try adding a function Index.select(ksize=ksize, moltype=moltype, ...) that would return a version of the Index that contained only signatures that matched those requirements. I also added a moltype property to the MinHash class.

These changes are more general than #809 and touch on a few other issues, like #599, and deserve to be tested and reviewed separately, so I'm breaking them out here.

  • Is it mergeable?
  • make test Did it pass the tests?
  • make coverage Is the new code covered?
  • Did it change the command-line interface? Only additions are allowed
    without a major version increment. Changing file formats also requires a
    major version number increment.
  • Was a spellchecker run on the source code and documentation after
    changes were made?

@ctb
Copy link
Contributor Author

ctb commented Apr 6, 2020

(FWIW I'm thinking of moving the moltype property to the MinHash object.)

@codecov
Copy link

codecov bot commented Apr 6, 2020

Codecov Report

Merging #936 into master will decrease coverage by 0.31%.
The diff coverage is 54.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #936      +/-   ##
==========================================
- Coverage   91.89%   91.58%   -0.32%     
==========================================
  Files          71       71              
  Lines        5021     5049      +28     
==========================================
+ Hits         4614     4624      +10     
- Misses        407      425      +18     
Impacted Files Coverage Δ
sourmash/sbt.py 85.69% <10.00%> (-1.10%) ⬇️
sourmash/lca/lca_db.py 93.77% <11.11%> (-2.66%) ⬇️
sourmash/_minhash.py 94.60% <100.00%> (-0.42%) ⬇️
sourmash/index.py 98.59% <100.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b90fad7...65514d7. Read the comment docs.

@sonarcloud
Copy link

sonarcloud bot commented Apr 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ctb ctb changed the title [WIP] add selector framework to Index, and moltype property to SourmashSignature [MRG] add selector framework to Index, and moltype property to MinHash object Apr 6, 2020
@ctb
Copy link
Contributor Author

ctb commented Apr 6, 2020

I think this is ready for a first round of comments, @luizirber, if you are interested :)

@@ -566,16 +566,19 @@ def is_molecule_type(self, molecule):
"""Check if this MinHash is a particular human-readable molecule type.

Supports 'protein', 'dayhoff', 'hp', 'DNA'.
@CTB deprecate for 4.0?
Copy link
Member

Choose a reason for hiding this comment

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

yes. See #751 for longer discussion, especially #751 (comment)

@ctb ctb mentioned this pull request Apr 18, 2020
5 tasks
@luizirber
Copy link
Member

Do you want to go all the way here and implement moltype/hash_function as an enum? Like a918b26 did (equivalent to #765 in Rust, implementing ideas from #751?)

@ctb
Copy link
Contributor Author

ctb commented Apr 19, 2020

(remaining comments moved to new issues)

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.

2 participants