-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add support for datetime64 and timedelta64 element types #308
Conversation
6549a5f
to
376b6c8
Compare
@kngwyu @davidhewitt I think this is ready for review now. There is one place where I am still undecided though: Whether I should provide conversions to/from Hence, I am currently leaning against providing any integration with std's time module (or with chrono for that matter). |
Thank you, the implementation looks nice, but let me a bit investigate how this can work together with PyO3's datatime. I have no experience of using numpy's datetime, and don't know much about its relationship with datetime in Python's std lib. |
Judging from what I learned so far, they seem to be rather different beasts, c.f. https://stackoverflow.com/questions/13703720/converting-between-datetime-timestamp-and-datetime64 So mainly instead of mucking around with calendars, time zones and other such complications, the NumPy datetime types seem to be rather scientifically minded having a huge range depending on the chosen unit but basically just differentiating between absolute ( |
Yeah, I also investigated a bit and found they are not very compatible. Let's launch this PR with some documents added. |
It basically works, but there are still quite a few things left to do:
define_units!
needs to learn about docstrings), integration testsunits
module? makedatetime
public without re-export? makedatetime
and within itunits
publicDatetime
andTimedelta
to provide?Duration
?SystemTime
? other crates likechrono
?PyArray::{copy_to,cast}
at the array levelDebug
impls onDatetime
andTimedelta
Closes #142