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

loading signatures from pathlist fails confusingly if pathlist contains bad paths #1845

Open
ctb opened this issue Feb 17, 2022 · 3 comments

Comments

@ctb
Copy link
Contributor

ctb commented Feb 17, 2022

below, if pathlist.txt contains a path that cannot be loaded, sourmash tells us that pathlist.txt can't be loaded instead of complaining about the specific file.

% sourmash sig fileinfo pathlist.txt

== This is sourmash version 4.2.5.dev19+g3a6028fb.d20220217. ==
== Please cite Brown and Irber (2016), doi:10.21105/joss.00027. ==

** loading from 'pathlist.txt'
Cannot open 'pathlist.txt'.
@ctb
Copy link
Contributor Author

ctb commented Mar 23, 2022

this is probably something where reporting the actual exception text can be the solution.

@ctb
Copy link
Contributor Author

ctb commented Apr 3, 2022

what happens when you use sourmash sig describe -d --

_load_databases: trying loader fn 3 'load from file list'
_load_databases: FAIL on fn 3 load from file list.
Traceback (most recent call last):
  File "/Users/t/dev/sourmash/src/sourmash/sourmash_args.py", line 450, in _load_database
    cache_size=cache_size)
  File "/Users/t/dev/sourmash/src/sourmash/sourmash_args.py", line 375, in _multiindex_load_from_pathlist
    db = MultiIndex.load_from_pathlist(filename)
  File "/Users/t/dev/sourmash/src/sourmash/index/__init__.py", line 1033, in load_from_pathlist
    file_list = load_pathlist_from_file(filename)
  File "/Users/t/dev/sourmash/src/sourmash/sourmash_args.py", line 560, in load_pathlist_from_file
    raise ValueError(f"file '{checkfile}' inside the pathlist does not exist") 
ValueError: file 'zzz.sig' inside the pathlist does not exist

so the problem is that the error that is raised from within the pathlist loading code is the same as "this is not a valid database to load, move on and try another".

so you get this top level output:

%  sourmash sig describe pathlist.txt 

== This is sourmash version 4.3.1.dev6+g03f2faec.d20220325. ==
== Please cite Brown and Irber (2016), doi:10.21105/joss.00027. ==

ERROR: Error while reading signatures from 'pathlist.txt'.

which is not very nice.

@ctb
Copy link
Contributor Author

ctb commented Aug 3, 2022

per #1414 (comment) maybe we should just remove pathlists altogether and standardize on --query-from-file and --from-file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant