-
Notifications
You must be signed in to change notification settings - Fork 80
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 a MultiIndex
class that wraps multiple Index classes.
#1374
Conversation
Codecov Report
@@ Coverage Diff @@
## latest #1374 +/- ##
==========================================
+ Coverage 89.18% 94.49% +5.30%
==========================================
Files 123 96 -27
Lines 18642 15176 -3466
Branches 1434 1447 +13
==========================================
- Hits 16626 14340 -2286
+ Misses 1780 603 -1177
+ Partials 236 233 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
MultiIndex
class that wraps multiple Index classes.MultiIndex
class that wraps multiple Index classes.
Ready for review @luizirber @bluegenes |
OK, upgraded a bit after some ...excursions. Cleaner, better, more succinct. |
Anything else to add to this, @ctb? Otherwise, go for merging =] |
thanks @luizirber - I'm doing some important downstream cleanup in #1406, and will fix any minor nits there. |
This PR adds a
MultiIndex
class, which provides a wrapper for otherIndex
classes. Each wrapped class should come with a paired location, which can beNone
; if set, the wrapper overrides the filename returned insearch
andgather
with the paired location.The PR also adds a
filter
method toLinearIndex
andMultiIndex
. This is a harbinger of selectors on scaled/num, #1072; I'm addingfilter
as an interim solution because I needed the functionality insourmash_args
and it made the code much cleaner.Addresses several of the issues in
DirectoryIndex
issue, #810.A side effect of switching to
MultiIndex
in varioussourmash_args
functions is that we can remove special-casing of SIGLIST in_load_databases
and dependent functions. This further simplifiesload_file_as_index
andload_file_as_signatures
. 👍In particular, this approach provides source filename information for where matches are coming from; see this comment for detailed rationale. Could perhaps replace the SBT
location
attribute in #1373 with wrapping an SBT in one of these (which seems like a hack in the long term, but could work fine in the short term ;).This wrapper approach may also provide a partial solution to lazy loading #1097, because it could support lazy loading of signatures by
Index
classes.TODO:
Checklist
make test
Did it pass the tests?make coverage
Is the new code covered?without a major version increment. Changing file formats also requires a
major version number increment.
changes were made?