Input parsing and validation
kakearney opened this issue · 1 comments
This issue is part of the JOSS review (openjournals/joss-reviews#2497)
Currently, none of the functions provide any form of input validation; this makes the toolbox very brittle and prone to uninformative errors. Input validation should be added to all functions to ensure that the correct number of inputs were passed, and that each input holds the type of data expected by the function (in terms of variable class, size, and value). When inputs fail the validation, informative error messages should be returned. When inputs point to files and/or folders, the function should check that the path exists and the files are of the expected format.
Many of the functions would be much more convenient to use if they allowed users to skip certain inputs and rely on default values. For example, argo_build
should only require one input: the files of interest. The region, start date, and end date inputs could default to the span within those files, and the variables could default to all variables in the files (or perhaps a subset of most commonly-accessed ones).
I have added input validation to functions and modified argo_build as suggested. Thanks for the advice!