-
Notifications
You must be signed in to change notification settings - Fork 6
datetime64 and timedelta64 #11
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
Comments
I think it would be great to have date/time dtypes in v3.
How would |
We should be careful to emphasize that these data types are intended for applications where compatibility with zarr v2 or numpy are high priority. For users who don't need zarr v2 / numpy compatibility, we could probably devise much better ways to represent dates / times than
numpy uses a signed 64 bit integer for |
What does "interval" mean? Where is the corresponding numpy documentation for |
In my example, "interval" meant "the smallest non-zero duration that scalars in a given import numpy as np
>>> np.ones((1,), dtype='datetime64[10s]')
array(['1970-01-01T00:00:10'], dtype='datetime64[10s]') Numpy does not provide extensive documentation for the "interval" might not be right word, we could also consider something like "step_size" or "duration" or "scale_factor". |
Oh, I didn't realize those numpy types supported an arbitrary scale factor. Effectively that is part of the unit --- you could call it |
sounds good to me! |
Zarr-python 2.x supported numpy's
datetime64
andtimedelta64
dtypes, which are described in the numpy documentation. Both of these data types are parametrized by a step size (a positive integer) and a unit (one of the temporal units listed here).We should add a description of this data type to zarr v3. I imagine the JSON metadata for these dtypes would look like this:
I think it would make sense to use a standard string datetime format for encoding fill values. There is a special value, called "not a time" or "NaT", which we could represent with a string literal
"NaT"
.The text was updated successfully, but these errors were encountered: