-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
move src/datetime.pxd funcs to np_datetime and fix misleading names #18045
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18045 +/- ##
==========================================
- Coverage 91.24% 91.23% -0.02%
==========================================
Files 163 163
Lines 50114 50114
==========================================
- Hits 45729 45720 -9
- Misses 4385 4394 +9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18045 +/- ##
==========================================
- Coverage 91.24% 91.23% -0.02%
==========================================
Files 163 163
Lines 50114 50114
==========================================
- Hits 45729 45720 -9
- Misses 4385 4394 +9
Continue to review full report at Codecov.
|
pandas/_libs/tslibs/np_datetime.pxd
Outdated
@@ -14,3 +16,6 @@ cdef check_dts_bounds(pandas_datetimestruct *dts) | |||
|
|||
cdef int64_t dtstruct_to_dt64(pandas_datetimestruct* dts) nogil | |||
cdef void dt64_to_dtstruct(int64_t dt64, pandas_datetimestruct* out) nogil | |||
|
|||
cdef int64_t _pydatetime_to_dt64(datetime val, pandas_datetimestruct *dts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would de-privatize
Any idea why |
I benchmarked this and it showed very little changes (as expected). something is still going on with your asv. you should always use affinity. |
Thanks for double-checking. |
The name
_pydatetime_to_dts
is misleading, sincedts
is the variable names used forpandas_datetimestruct
objects, while the func actually returns an int64. This renames it to_pydatetime_to_dt64
.The analogous function for
datetime.date
has the non-misleading name_date_to_datetime64
. For consistency this is renamed to_pydate_to_dt64
.Both are moved to
np_datetime
, and have their inputs typed asdatetime
anddate
instead ofobject
.