-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
New: IssueHighlight a new community raised "generic" issueHighlight a new community raised "generic" issue
Milestone
Description
CalendarDateTime served a purpose in the early days of nc-time-axis, but I now think it may not be needed anymore, particularly once #75 is addressed (#80). cftime.datetime instances now have a meaningful calendar attribute and their comparisons now check that calendars and datetime components are equal. Should we include a DeprecationWarning in the next release of nc-time-axis?
As an aside, reading some of the existing tests for CalendarDateTime makes me a little uneasy now that cftime.datetime objects have a default calendar of "gregorian" instead of None:
nc-time-axis/nc_time_axis/tests/unit/test_NetCDFTimeConverter.py
Lines 116 to 121 in 59c567d
| def test_cftime_CalendarDateTime(self): | |
| val = CalendarDateTime(cftime.datetime(2014, 8, 12), "365_day") | |
| result = NetCDFTimeConverter().convert(val, None, None) | |
| expected = 5333.0 | |
| assert result == expected | |
| assert np.isscalar(result) |
Apparently these still pass despite the fact that the
calendar of the datetime object does not match the calendar of the CalendarDateTime object.Metadata
Metadata
Assignees
Labels
New: IssueHighlight a new community raised "generic" issueHighlight a new community raised "generic" issue