Open truth-quark opened 5 months ago
Hmm yes that is true, but the helpers.get_abspath()
function might still be needed to get the path we want logged.
I think Python's IOError
does not necessarily output the absolute path, but whatever argument was given as a path.
Ooops, Python throws a FileNotFound
error which shows the path (abs or relative, whichever is passed to the func). This is fine as um2nc
doesn't change the working directory.
Yeah, I created the get_abspath()
function to log the absolute paths. Even though um2nc
does not change working directory, I usually prefer working with absolute paths in general.
In the interest of simplicity, I recommend going with a minimal implementation, deferring to Python defaults etc. Each specialisation, additional code branching etc contributes to more complexity, more testing and so forth. The less code we have, the easier it is for different devs to understand & maintain :-)
Yes that makes sense. Well, for now we can remove it, then if we need a way to work with absolute paths we will reinstate it.
However, if we remove it, we neeed a function to check existence of files and directories to replace the logic of the check
and checkdir
input arguments to get_abspath()
.
The
helpers.get_abspath()
function is not required once #40 is complete:sys.exit()
calls from the custom logging module are being removedget_abspath()
throwsIOError
if files are missing (duplicating Python's functionality).