DavideNardone / MTSS-Multivariate-Time-Series-Software

A GP-GPU/CPU Dynamic Time Warping (DTW) implementation for the analysis of Multivariate Time Series (MTS).
MIT License
45 stars 8 forks source link

Command line options library #19

Closed krischer closed 5 years ago

krischer commented 5 years ago

A lot of the code in MD_DTW.cu deals with the parsing of command line option. This is hard to read and maintain and fairly error-prone. Please consider using either a standard tool like getopt or another existing library (e.g. https://www.argtable.org/).

Part of a review at: https://github.com/openjournals/joss-reviews/issues/1049

DavideNardone commented 5 years ago

The scenario of using the getopt utility has already been considered but, unfortunately since the POSIX standard getopt does not support multiple arguments for a single flag option I had to to adopt an ad hoc solution. In addition, the arguments provided by the software are not just single flag letters but in some cases array of characters. By saying that, I honestly think it's not worth to encapsulate my code into the getopt utility since it's application does not make any difference or makes my scenario harder to code.

However, the logic behind the code i wrote for parsing the command line options is quite similar to getopt. To make the code more readable and less prone to errors I agree to re-modularized it and test it better.