Conversation
|
@spencerkclark - your latest improvements to date2num and num2date work so well that I decided to go ahead and use them everywhere. Would you mind running this with the xarray test suite? If it all looks good, I will merge and create a 1.2.0 release. |
spencerkclark
left a comment
There was a problem hiding this comment.
Wow thanks @jswhit -- this is great. The xarray test suite passes with the code as written, but I have a few questions/suggestions.
One thing I also noticed while playing around with this -- you could address it here or I could open a separate PR -- is that the repr updated in #177 does not include the minutes of the datetime. I'm guessing this was a simple mistake, but would probably be good to fix before a release!
Lines 1677 to 1680 in ca851ca
This results in confusing reprs such as:
In [1]: import cftime
In [2]: cftime.num2date([0, 15, 30], units="minutes since 2000-01-01", calendar="noleap")
Out[2]:
array([cftime.DatetimeNoLeap(2000, 1, 1, 0, 0, 0),
cftime.DatetimeNoLeap(2000, 1, 1, 0, 0, 0),
cftime.DatetimeNoLeap(2000, 1, 1, 0, 0, 0)], dtype=object)
spencerkclark
left a comment
There was a problem hiding this comment.
Thanks for catching that repr bug! Fixed now, along with the masked array bug.
Getting rid of the loop in date2num is going to be trickier, since there are so may checks/if tests in there. Going to leave that for another PR.
Sounds good! Thanks for the fixes. This looks good to me; I confirmed again that the xarray test suite passes with these changes.
JulianDayFromDate, DateFromJulianDay no longer used internally.
Bump version number to 1.2.0.