-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Cleanup cimports, implement bits of numpy_helper in util.pxd #21878
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 #21878 +/- ##
=======================================
Coverage 91.91% 91.91%
=======================================
Files 164 164
Lines 49992 49992
=======================================
Hits 45952 45952
Misses 4040 4040
Continue to review full report at Codecov.
|
@@ -9,14 +9,12 @@ from cpython.slice cimport PySlice_Check | |||
import numpy as np | |||
cimport numpy as cnp | |||
from numpy cimport (ndarray, float64_t, int32_t, | |||
int64_t, uint8_t, uint64_t, intp_t) | |||
int64_t, uint8_t, uint64_t, intp_t, | |||
# Note: NPY_DATETIME, NPY_TIMEDELTA are only available |
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.
prob can remove this comment (future PR ok)
@@ -54,7 +52,8 @@ from tslibs.timestamps cimport (create_timestamp_from_ts, | |||
_NS_UPPER_BOUND, _NS_LOWER_BOUND) | |||
from tslibs.timestamps import Timestamp | |||
|
|||
cdef bint PY2 = str == bytes | |||
|
|||
DEF PY2 = str == bytes |
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.
we should define in util.pxd maybe (future ok)
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 doubt that works for DEF values, but not much downside.
@@ -334,8 +334,6 @@ class _BaseOffset(object): | |||
# other is not a DateOffset object | |||
return False | |||
|
|||
return self._params == other._params |
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.
this didn't break anything?
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.
Was unreachable; there was a compile-time warning about it.
from resolution import Resolution | ||
from nattype import nat_strings, NaT, iNaT | ||
from nattype cimport _nat_scalar_rules, NPY_NAT, is_null_datetimelike | ||
from offsets cimport to_offset | ||
from offsets import _Tick | ||
|
||
cdef bint PY2 = str == bytes | ||
DEF PY2 = str == bytes |
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.
same
thanks @jbrockmendel a couple of things ought to do in the future PRs |
Removes a few unnecessary uses of
cnp.import_array()
Uses cython's conditional compilation to avoid runtime PY2/PY3 checks
Arranges cython imports in stdlib-->3rd party--> internal order.
Separates out the one part of
libresolution._FrequencyInferer
that we actually do want to keep in cythonCouple of small lintings in groupby.pyx