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

ExtractTiles check for empty dirs bug #277

Closed
georgemccabe opened this issue Jul 31, 2019 · 2 comments
Closed

ExtractTiles check for empty dirs bug #277

georgemccabe opened this issue Jul 31, 2019 · 2 comments
Assignees
Labels
component: use case wrapper priority: high High Priority type: bug Fix something that is not working

Comments

@georgemccabe
Copy link
Collaborator

ExtractTiles calls TcPairs wrapper and checks if the input directory is empty and exits if it is empty. However, a dated subdirectory can exist in this directory and this check will pass even though that directory is empty. TcPairs is attempted to run with no files in the list so the -lookin flag has no argument, so it fails. Instead of checking if the dir is empty, we should add a check to see if the file list is empty and error or warn and exit instead of running tc_pairs with an incorrectly formatted command.

@georgemccabe georgemccabe added type: bug Fix something that is not working component: use case wrapper priority: high High Priority labels Jul 31, 2019
@georgemccabe georgemccabe added this to the METplus-3.0 Release milestone Jul 31, 2019
@bikegeek bikegeek self-assigned this Nov 4, 2019
@bikegeek
Copy link
Contributor

bikegeek commented Nov 18, 2019

The extract tiles wrapper invokes the tc-stat tool via the TcStat wrapper but first checks that the tc-pairs output left behind by invoking the MET tc-pairs tool (via METplus TcPairs wrapper) has created any output. There are some instances where there are dated subdirectories created by the TcPairs wrapper with no .tcst files as output. Currently, there is only a check for the empty tc-pairs output directory. Change the check for util.is_dir_empty to obtain a list of all files and check for non-zero number of files instead. Problem has been reproduced, creating the following error message from the MET tc-stat tool:

_ERROR :
ERROR : process_command_line(int argc, char **argv) -> You must specify at least one source using the "-lookin" option.
ERROR :

*** Model Evaluation Tools (METV8.1.1) ***

Usage: tc_stat
-lookin source_

bikegeek added a commit that referenced this issue Nov 19, 2019
….tcst files produced by the tc-pairs wrapper before creating the tc-stat command.

The tc-stat command raises an error if there is an empty list to the -lookin argument.  Now the check verifies whether there are .tcst files, and if not, errors and logs an appropriate error message.
@bikegeek
Copy link
Contributor

Now we get a list of all files in all dirs and if empty, log an error message indicating that no .tcst files exist, then exit. If .tcst files exist, proceed as usual using these files as arguments to the -lookin flag and invoke tc_stat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: use case wrapper priority: high High Priority type: bug Fix something that is not working
Projects
None yet
Development

No branches or pull requests

2 participants