NOC-MSM / pyBDY

pyBDY: a Python based regional NEMO model configuration toolbox.
GNU General Public License v3.0
7 stars 7 forks source link

PyNEMO crashes when time series requested is longer than data held #46

Closed thopri closed 4 years ago

thopri commented 4 years ago

Currently PyNEMO will crash with a interpolation warning (on benckmark) if the analysis requested, i.e. month_000 and month_end are larger than the data defined in the NCML file.

Need to clearly inform user this is the problem rather than unhelpful error.

thopri commented 4 years ago

Have added a try except block around the relevant part of the code, if the value error occurs where x_new is greater than x, indicating time series mismatch. The error is then printed to screen (to help with debugging) and a descriptive helpful error message regarding potential time horizon discrepancy is sent to the log file. Finally the value error is raised with same descriptive error message that was sent to the logger.

Commit ref 8341942c5a55cd132e24921e4e40d7f80f07c876