DeltaRCM / pyDeltaRCM

Delta model with a reduced-complexity approach
https://deltarcm.org/pyDeltaRCM/
MIT License
18 stars 11 forks source link

Remove try-except from save_grids() #236

Closed elbeejay closed 2 years ago

elbeejay commented 2 years ago

Currently, save_grids() allows writing to the netCDF to fail without crashing the model via the use of a try-except statement.

This can be problematic as it:

Barring some rational for keeping this in the code, I will implement a "bugfix" to remove this in a few weeks.

amoodie commented 2 years ago

sounds good to me, I can't think of any time someone would want to be recording to netcdf and then not care that recording stopped working.

To be clear, the "fix" here will be to change the behavior and raise an error to crash the run? Let's just try to make that error and log message as helpful as possible, e.g., recording the expected location of the file and whatever error information is raised from the netcdf library.

elbeejay commented 2 years ago

To be clear, the "fix" here will be to change the behavior and raise an error to crash the run? Let's just try to make that error and log message as helpful as possible, e.g., recording the expected location of the file and whatever error information is raised from the netcdf library.

Yes aim would be to raise an error and force the run to stop. Good thoughts on the error/log message, will make them as informative as possible :+1: