For the convenience in importing decompose_flow_vectors in other programs such as WPS processes, the input validity checking procedure in main() has been refactored into source_check and variable_check functions. The advantage of the functions is that they do not need terminal input for arguments, thus they can be called in any programs that do not require terminal inputs.
The functions throw an user-defined exception if any error conditions are met, and main() SystemExits the program when it catches an exception. There are two main user-defined exceptions(InvalidSourceError and InvalidVariableError) and 5 other exceptions that inherit the main exceptions. The reason for having many specific exceptions is to manage versatile error conditions when the functions are called in other programs
This PR closes issue #126
For the convenience in importing
decompose_flow_vectors
in other programs such as WPS processes, the input validity checking procedure in main() has been refactored intosource_check
andvariable_check
functions. The advantage of the functions is that they do not need terminal input for arguments, thus they can be called in any programs that do not require terminal inputs.The functions throw an user-defined exception if any error conditions are met, and main()
SystemExit
s the program when it catches an exception. There are two main user-defined exceptions(InvalidSourceError and InvalidVariableError) and 5 other exceptions that inherit the main exceptions. The reason for having many specific exceptions is to manage versatile error conditions when the functions are called in other programs