-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
import from np_datetime instead of src/datetime #18312
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
@@ -50,6 +50,11 @@ cdef extern from "../src/datetime/np_datetime.h": | |||
PANDAS_FR_fs | |||
PANDAS_FR_as | |||
|
|||
int days_per_month_table[2][12] | |||
int dayofweek(int y, int m, int d) nogil | |||
int is_leapyear(int64_t year) nogil |
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.
There are a couple of modules that use one or more of these three items but dont need the rest of the relatively heavy-weight src/datetime/np_datetime dependency. Ideally I'd prefer for these to be implemented in a dependency-free cython module.
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.
sure these are like dateutils
Codecov Report
@@ Coverage Diff @@
## master #18312 +/- ##
==========================================
- Coverage 91.39% 91.38% -0.02%
==========================================
Files 164 164
Lines 49854 49854
==========================================
- Hits 45566 45557 -9
- Misses 4288 4297 +9
Continue to review full report at Codecov.
|
@@ -50,6 +50,11 @@ cdef extern from "../src/datetime/np_datetime.h": | |||
PANDAS_FR_fs | |||
PANDAS_FR_as | |||
|
|||
int days_per_month_table[2][12] | |||
int dayofweek(int y, int m, int d) nogil | |||
int is_leapyear(int64_t year) nogil |
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.
sure these are like dateutils
thanks! |
Really? I was expecting a "no" because it would be duplicating stuff already in src/datetime/np_datetime, but if that's the go-ahead, then I'll put that together this week. Name-wise I was thinking |
well i wouldn’t duplicate stuff rather should be orthogonal - maybe not sure what u r proposing here |
No worries, I've got plenty of other stuff to work on, will get distracted by something shiny and forget about this idea. |
There are a handful of things where there is an option to cimport from either tslibs.np_datetime or src/datetime.pxd. This PR updates imports use tslibs.np_datetime where possible.
Exposes NPY_NAT in nattype.pxd so other modules can cimport it from there instead of using util.get_nat(). Thematically
nattype
is the appropriate place for this to come from.I don't think this has any overlaps with #18298.
git diff upstream/master -u -- "*.py" | flake8 --diff