-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[C++] duration
add missing kernels
#39233
Comments
duration
add missing arithmetic kernelsduration
add missing kernels
Thanks for checking! Most of the missing ones should be trivial to implement. I'll take a look soon. |
take |
### Rationale for this change Add kernels for durations. ### What changes are included in this PR? In this PR I added the ones that require only registration and unit tests. More complicated ones will be in another PR for readability. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: #39233 Authored-by: Jin Shang <shangjin1997@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
### Rationale for this change Add kernels for durations. ### What changes are included in this PR? In this PR I added the ones that require only registration and unit tests. More complicated ones will be in another PR for readability. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39233 Authored-by: Jin Shang <shangjin1997@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
### Rationale for this change Add kernels for durations. ### What changes are included in this PR? In this PR I added the ones that require only registration and unit tests. More complicated ones will be in another PR for readability. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39233 Authored-by: Jin Shang <shangjin1997@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
### Rationale for this change Add kernels for durations. ### What changes are included in this PR? In this PR I added the ones that require only registration and unit tests. More complicated ones will be in another PR for readability. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39233 Authored-by: Jin Shang <shangjin1997@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
### Rationale for this change Add kernels for durations. ### What changes are included in this PR? In this PR I added the ones that require only registration and unit tests. More complicated ones will be in another PR for readability. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#39233 Authored-by: Jin Shang <shangjin1997@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
There are 2 more operations supported by
In both cases, import numpy as np
td = np.timedelta64(5, "D")
print(td * 1.5) # 7 days (rounded towards 0 from 7.5)
print(td / 1.5) # 3 days (rounded towards 0 from 3.3333....)
print(td * -1.55) # -7 days (rounded towards 0 from -7.75) Especially the multiply kernel would be very useful, because it is the inverse operation to the |
@js8544 I updated the list with the kernel available in the 16.0 release |
Describe the enhancement requested
There are lots of kernels missing on the duration type for feature-parity with e.g.
numpy.timedelta64
. Since duration types are basically just wrapped integers, most of the integer kernels should be transferrable, with some exceptions (e.g.prod
does not make sense since it would change the physical units)I ran a script to figure out what is currently supported.
EDIT: updated with
pyarrow
16.0Unary Ops
Binary Ops
Additional Ops
These are somewhat questionable, as they require rounding. They are supported by
numpy.timedelta64
arrays.Component(s)
C++
The text was updated successfully, but these errors were encountered: