-
Notifications
You must be signed in to change notification settings - Fork 49
Closed
Description
We currently blanket disallow month or year intervals when passing operations down to cftime:
Lines 1932 to 1939 in 37c8400
| # `cftime` cannot parse long time intervals ("months" or "years"). | |
| if self.is_long_time_interval(): | |
| interval = self.origin.split(" ")[0] | |
| emsg = ( | |
| 'Time units with interval of "months", "years" ' | |
| '(or singular of these) cannot be processed, got "{!s}".' | |
| ) | |
| raise ValueError(emsg.format(interval)) |
cftime disallows these intervals, presumably because it requires consistent-length time increments. But cftime is more intelligent about this than cf-units is, e.g. month intervals are allowed for 360_day calendars (Unidata/cftime#75).
We should make sure our own checks don't cover over details like the 360_day exception. The Pythonic choice would be to do no extra checks at all in cf-units, simply relying on cftime to raise the appropriate error; is there a good reason why we don't do this?
bjlittle