Skip to content
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

Rename load_file_list_of_signatures to load_pathlist_from_file #1423

Merged
merged 8 commits into from
Apr 2, 2021
4 changes: 2 additions & 2 deletions src/sourmash/command_sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def __call__(self):

def _add_from_file_to_filenames(args):
"Add filenames from --from-file to args.filenames"
from .sourmash_args import load_file_list_of_signatures
from .sourmash_args import load_pathlist_from_file
if args.from_file:
file_list = load_file_list_of_signatures(args.from_file)
file_list = load_pathlist_from_file(args.from_file)
args.filenames.extend(file_list)


Expand Down
6 changes: 3 additions & 3 deletions src/sourmash/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def compare(args):

inp_files = list(args.signatures)
if args.from_file:
more_files = sourmash_args.load_file_list_of_signatures(args.from_file)
more_files = sourmash_args.load_pathlist_from_file(args.from_file)
inp_files.extend(more_files)

progress = sourmash_args.SignatureLoadingProgress()
Expand Down Expand Up @@ -353,7 +353,7 @@ def index(args):

inp_files = list(args.signatures)
if args.from_file:
more_files = sourmash_args.load_file_list_of_signatures(args.from_file)
more_files = sourmash_args.load_pathlist_from_file(args.from_file)
inp_files.extend(more_files)

if not inp_files:
Expand Down Expand Up @@ -725,7 +725,7 @@ def multigather(args):
args.db = [item for sublist in args.db for item in sublist]
inp_files = [item for sublist in args.query for item in sublist]
if args.query_from_file:
more_files = sourmash_args.load_file_list_of_signatures(args.query_from_file)
more_files = sourmash_args.load_pathlist_from_file(args.query_from_file)
inp_files.extend(more_files)

# need a query to get ksize, moltype for db loading
Expand Down
2 changes: 1 addition & 1 deletion src/sourmash/lca/command_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def classify(args):
notify('finding query signatures...')
inp_files = list(args.query)
if args.query_from_file:
more_files = sourmash_args.load_file_list_of_signatures(args.query_from_file)
more_files = sourmash_args.load_pathlist_from_file(args.query_from_file)
inp_files.extend(more_files)

if not check_files_exist(*inp_files):
Expand Down
2 changes: 1 addition & 1 deletion src/sourmash/lca/command_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def index(args):

inp_files = list(args.signatures)
if args.from_file:
more_files = sourmash_args.load_file_list_of_signatures(args.from_file)
more_files = sourmash_args.load_pathlist_from_file(args.from_file)
inp_files.extend(more_files)

# track duplicates
Expand Down
2 changes: 1 addition & 1 deletion src/sourmash/lca/command_summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def summarize_main(args):
inp_files = args.query

if args.query_from_file:
more_files = sourmash_args.load_file_list_of_signatures(args.query_from_file)
more_files = sourmash_args.load_pathlist_from_file(args.query_from_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please create a new issue for testing --query-from-file for sourmash lca summarize - thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(because our current tests don't execute this, apparently!)

inp_files.extend(more_files)

if not inp_files:
Expand Down
4 changes: 2 additions & 2 deletions src/sourmash/sourmash_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def _load_database(filename, traverse_yield_all, *, cache_size=None):
idx_list = []
src_list = []

file_list = load_file_list_of_signatures(filename)
file_list = load_pathlist_from_file(filename)
for fname in file_list:
idx = load_file_as_index(fname)
src = fname
Expand Down Expand Up @@ -485,7 +485,7 @@ def load_file_as_signatures(filename, select_moltype=None, ksize=None,
return loader


def load_file_list_of_signatures(filename):
def load_pathlist_from_file(filename):
"Load a list-of-files text file."
try:
with open(filename, 'rt') as fp:
Expand Down