Skip to content

Commit

Permalink
cleanup of comments etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Jun 17, 2021
1 parent e1e367a commit 9e46ff8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/sourmash/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,14 +1014,12 @@ def make_manifest_row(cls, ss, location, *, include_signature=True):
row['with_abundance'] = 1 if ss.minhash.track_abundance else 0
row['name'] = ss.name
row['filename'] = ss.filename
# @CTB: do we want filename in manifests?
row['internal_location'] = location
# @CTB: change key, maybe just make it 'location'

assert set(row.keys()) == set(cls.required_keys)

# if requested, include the signature in the manifest.
if include_signature:
# CTB: track signature when creating manifest w/this info.
row['signature'] = ss
return row

Expand Down Expand Up @@ -1054,18 +1052,19 @@ def _select(self, *, ksize=None, moltype=None, scaled=0, num=0,
matching_rows = ( row for row in matching_rows
if row['moltype'] == moltype )
if scaled or containment:
# CTB: check scaled AND containment per select_signature
# CTB: check num, per select_signature?
if containment and not scaled:
raise ValueError("'containment' requires 'scaled' in Index.select'")

matching_rows = ( row for row in matching_rows
if int(row['scaled']) )
if int(row['scaled']) and not int(row['num']) )
if num:
# CTB: check scaled, per select_signature?
matching_rows = ( row for row in matching_rows
if int(row['num']) )
if int(row['num']) and not int(row['scaled']) )

if picklist:
matching_rows = ( row for row in matching_rows
if picklist.matches_siginfo(row) )

# return only the internal filenames!
for row in matching_rows:
yield row
Expand Down

0 comments on commit 9e46ff8

Please sign in to comment.