-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read_dates returns dtype('O')
instead of dtype('<M8[ns]')
#49
Comments
Ok the problem is related to the fact that the default behavior of @cpaulik: Do you have an opinion on this issue? Should we change to the previous default behavior forcing to return I think the type conversion to Reverting it to the "old behavior" would look like:
|
Is there any benefit to the |
As discussed in these issues Unidata/netcdf4-python#981 and Unidata/cftime#134 there were some problems with rounding and negative times, which can be surprising sometimes. Probably a good summary is this comment:
|
Reverted it to old behavior with a7ee3a9 for now |
netCDF4.num2date
used here seems to return anumpy.dtype('O')
, which laters leads to troubles because it is expected to get a datetime object, likenumpy.dtype('<M8[ns]')
. I couldn't track down if this is related to a certain version of netCDF4 or numpy (or even cftime)Using
return self.dates.astype('datetime64[ns]')
here seems to be a workaround, but I'm not sure if this is the best solution give the fact that is unknown which package/version is causing the problem.The text was updated successfully, but these errors were encountered: