Skip to content

Commit

Permalink
fewer loops are good
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Sep 29, 2023
1 parent 20d2f4c commit a6fba2a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/sourmash/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ def compare(args):
yield_all_files=args.force,
progress=progress,
pattern=pattern_search)
loaded = list(loaded)
if not loaded:
notify(f'\nwarning: no signatures loaded at given ksize/molecule type/picklist from {filename}')

# add to siglist; track ksizes/moltypes
s = None
for s in loaded:
siglist.append((s, filename))
ksizes.add(s.minhash.ksize)
moltypes.add(sourmash_args.get_moltype(s))

if s is None:
notify(f'\nwarning: no signatures loaded at given ksize/molecule type/picklist from {filename}')

# error out while loading if we have more than one ksize/moltype
if len(ksizes) > 1 or len(moltypes) > 1:
break
Expand Down Expand Up @@ -134,6 +134,10 @@ def compare(args):
if track_abundances:
notify('NOTE: --containment, --max-containment, --avg-containment, and --estimate-ani ignore signature abundances.')

# CTB: note, up to this point, we could do everything with manifests
# w/o actually loading any signatures. I'm not sure the manifest
# API allows it tho.

# if using scaled sketches or --scaled, downsample to common max scaled.
printed_scaled_msg = False
if is_scaled:
Expand Down

0 comments on commit a6fba2a

Please sign in to comment.