-
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] Creating an inflate
function to copy abundances from one MinHash
to another
#1620
Conversation
Codecov Report
@@ Coverage Diff @@
## latest #1620 +/- ##
==========================================
+ Coverage 82.64% 90.00% +7.36%
==========================================
Files 114 87 -27
Lines 12189 8391 -3798
Branches 1554 1555 +1
==========================================
- Hits 10073 7552 -2521
+ Misses 1855 578 -1277
Partials 261 261
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@ctb Please review. Does the function seem fine in both the |
well, see below:
Do you see the code block from #1463 in |
No, I don't see it. |
Please see block starting here: https://github.com/sourmash-bio/sourmash/blob/latest/src/sourmash/commands.py#L804 |
This chunk of code is not present in my current code. Is there a way that I can get this code by pulling from a certain branch perhaps? Should I maybe update from latest? |
yes, that link is a pointer to the latest branch. |
I still can't see that particular chunk of code, even after merging the branches. |
I'm not sure what to tell you - it's in the pull request now, https://github.com/sourmash-bio/sourmash/blob/KB_1463/src/sourmash/commands.py#L804 Did you need to reload the file in your editor, perhaps? |
I reloaded it as well, but I still can't see it. |
can you copy and paste the output of:
here, please? thanks! |
This is all for
This is all for
|
ok - on line 804 of
|
okay, yes I see it now. |
So, this chunk of code is to be removed from here and written in the function |
yep!
|
do I still need to keep the code that I've written for the |
On Tue, Jun 22, 2021 at 04:53:51PM -0700, Keya Barve wrote:
do I still need to keep the code that I've written for the `inflate` function already?
I don't know ;).
|
I wrote a separate function in |
yes, I think so - some suggestions,
|
When I remove the function from |
get something working before fine tuning it :) |
I had a couple of questions:
where the
|
The |
@ctb I believe it is this:
in |
alas, no :). let's trace that back - the signature is loaded from |
I believe it is this code:
|
Yep. When you look at the diff from the code that was there before (and was passing the test), do you see anything missing from the current code in comparison to the old code that might be triggering the test failure? |
This was the original code:
And this is the new code in the
The only differences are that |
Here, |
Oh I see, so then it would be
|
please see #1691 |
I have merged the branch created by @ctb to resolve some of the issues and was wondering if there is anything more to be done. I have written 2 tests already to test the |
please read and fix and/or resolve all of the issues mentioned in previous reviews; you can see them in the file tab. when a PR is ready for review, please change its name to [MRG] and ask for a review. |
inflate
function to copy abundances from one MinHash
to anotherinflate
function to copy abundances from one MinHash
to another
@ctb This is ready for review. I had one question though: You had mentioned this comment in the original issue: "Check if the code can apply to |
multigather currently flattens unmatched hatches - see the comment At this point I suggest opening a new issue to add saving of abundances for unassigned hashes to multigather. Then, if you want to tackle the issue in the future, start by writing a test based on the |
src/sourmash/minhash.py
Outdated
orig_abunds = from_mh.hashes | ||
abunds = { h: orig_abunds[h] for h in hashes } | ||
|
||
abund_query_mh = from_mh.copy_and_clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do change this to abund_mh
unless you have a reason otherwise.
@ctb Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Fixes #1463
Done:
commands.gather()
.inflate
in theMinHash
class ofsrc/sourmash/minhash.py
.self
, aMinHash
object calledfrom_mh
withtrack_abundance=True
.from_mh
using only the hashes fromself
.tests/test_minhash.py
for testing the function.Frozen MinHash
class ofsrc/sourmash/minhash.py
.multigather
as well.