Skip to content

Commit

Permalink
add no_clear optional argument for set_abundances(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikyoung85 committed Jun 25, 2020
1 parent a7c07eb commit 107d63d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sourmash/_minhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,14 @@ def __iadd__(self, other):

merge = __iadd__

def set_abundances(self, values):
def set_abundances(self, values, no_clear=False):
"""Set abundances for hashes from ``values``, where
``values[hash] = abund``
"""
if self.track_abundance:
hashes = []
abunds = []
if not no_clear:
hashes = []
abunds = []
for h, v in values.items():
hashes.append(h)
abunds.append(v)
Expand Down

0 comments on commit 107d63d

Please sign in to comment.