Consistency in offline tools to abort if a file to be read doesn't exist and abort if a file created already exists...
- Dominant language
- Fortran
- Stars
- 352
- Forks
- 361
- Avg merge
- 6d 6h
- Merged PRs (30d)
- 8
Description
I'm just elevating this to a discussion. I think the behavior of our offline tools should be that files to be read in are first checked for existence. If they don't exist -- the tool aborts with error explaining that the file doesn't exist. This is helpful to do since the error message given when a tool finds a problem can be hard to decipher.
Similarly if a file is going to be created, and it's going to overwrite an existing file, that file existence is checked for and it will die with an error alerting the user that the file exists. So then the user can delete the file, or rename it in order to allow creation of the new one. This is in contrast to CTSM which will just overwrite files. But, that's helpful because the list of files is long and it can happen after running for some time. Here for offline tools where the number of output files will be small, I think this makes more sense.
If we agree to this behavior we can add this to:
https://github.com/ESCOMP/CTSM/blob/master/doc/design/python_script_user_interface.rst
It is a user-interface behavior that it's good to have a convention around.
Contributor guide
Assessment
This issue has not been assessed yet.