-
Notifications
You must be signed in to change notification settings - Fork 41
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
Issue318 handle missing or invalid path input for commands #322
Issue318 handle missing or invalid path input for commands #322
Conversation
Codecov Report
@@ Coverage Diff @@
## master #322 +/- ##
==========================================
+ Coverage 99.49% 99.57% +0.08%
==========================================
Files 56 56
Lines 2944 3041 +97
==========================================
+ Hits 2929 3028 +99
+ Misses 15 13 -2
Continue to review full report at Codecov.
|
I don't have a strong opinion, but in general, more tests is always better and while the new tests are a bit redundant, they do clarify the intended behaviour. So I'd rather leave them in. I tested the behavior of
It's similar with
Both kind of errors can also happen if the training data is too small, for example if it consists entirely of stop words (as noted in the Test coverage is a bit lacking: there is no test for the "Creating empty model" case. Other than that, this seems good for merging! |
Uups, wait, not ready yet! Forgot to check the behaviour for PAV backend. |
Now added the check for empty documents/corpus also for PAV. The current behaviour for different backends is below.
|
Looks good! A couple of minor issues:
+1 for merging. |
Closes #318.
Adding
exists=True
argument totype=click.Path()
enables Click to check the existence of paths, for example:There are now tests for raising these errors for every command, but to me they actually seem a bit too much. After all, there is no actual Annif code that these tests check. To not bloat the test code base, should the test be removed or reduced in number?
The case of missing training file now maps to
/dev/null
, but as noted, it doesn't work in Windows. This behaviour would still needuse cross-platform null device file
checks on the running OS (easy actually),and implementing different behaviour for
vw-multi
compared to other backends (seems a bit complicated)Could this behaviour on missing training file be dropped for now, as the use case seems quite rare, and "a workaround" (if one doesn't want or can't use
/dev/null
) for this is to create an actual, existing empty training file and train on that?