Skip to content

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

Merged
merged 3 commits into from
Jul 14, 2018

Conversation

jbrockmendel
Copy link
Member

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 cython

Couple of small lintings in groupby.pyx

@gfyoung gfyoung added Internals Related to non-user accessible pandas implementation Clean labels Jul 12, 2018
@codecov
Copy link

codecov bot commented Jul 12, 2018

Codecov Report

Merging #21878 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21878   +/-   ##
=======================================
  Coverage   91.91%   91.91%           
=======================================
  Files         164      164           
  Lines       49992    49992           
=======================================
  Hits        45952    45952           
  Misses       4040     4040
Flag Coverage Δ
#multiple 90.3% <ø> (ø) ⬆️
#single 42.16% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bdb6168...003babf. Read the comment docs.

@jreback jreback added this to the 0.24.0 milestone Jul 14, 2018
@@ -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
Copy link
Contributor

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
Copy link
Contributor

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)

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@jreback jreback merged commit f3160bf into pandas-dev:master Jul 14, 2018
@jreback
Copy link
Contributor

jreback commented Jul 14, 2018

thanks @jbrockmendel a couple of things ought to do in the future PRs

@jbrockmendel jbrockmendel deleted the cyprelim branch July 14, 2018 15:50
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Jul 15, 2018
jbrockmendel added a commit that referenced this pull request Jul 15, 2018
aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Jul 20, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants