Skip to content

CLN: separate out groupby algos #15775

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

Closed
wants to merge 2 commits into from
Closed

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Mar 21, 2017

  • separate out groupby algorithms to separate lib
  • release GIL on median
  • release GIL on is_lexsorted / fix memory leak
  • release GIL on nancorr

Py_ssize_t n, nlevels
int64_t k, cur, pre
ndarray arr
bint result = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

We're not consistent on this, but I think using True/False on bint is clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you can't do that inside a nogil though

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to work, although may not in all versions?

%%cython
def f():
    cdef bint result = True
    with nogil:
        result = False
    return result

f()
Out[32]: False

cython.__version__
Out[33]: '0.24.1'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes as long as you don't return it directly. I made the change anyhow

n = len(list_of_arrays[0])

cdef int64_t **vecs = <int64_t**> malloc(nlevels * sizeof(int64_t*))
for i from 0 <= i < nlevels:
Copy link
Contributor

Choose a reason for hiding this comment

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

Since moving all this could take the opportunity to update loops using this old syntax to range(...), though not a big deal

@@ -0,0 +1,291 @@
# cython: profile=False

from numpy cimport *
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably don't need the import *?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure, that's a pretty standard import.

release GIL on is_lexsorted / fix memory leak
release GIL on nancorr
@codecov
Copy link

codecov bot commented Mar 22, 2017

Codecov Report

Merging #15775 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #15775      +/-   ##
==========================================
- Coverage   91.01%      91%   -0.02%     
==========================================
  Files         143      143              
  Lines       49403    49403              
==========================================
- Hits        44966    44957       -9     
- Misses       4437     4446       +9
Impacted Files Coverage Δ
pandas/core/groupby.py 94.96% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.86% <0%> (-0.1%) ⬇️
pandas/tseries/index.py 95.29% <0%> (-0.1%) ⬇️
pandas/core/common.py 91.3% <0%> (+0.33%) ⬆️

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 32dd929...4e2bfec. Read the comment docs.

@jreback jreback closed this in fb7af6e Mar 22, 2017
mattip pushed a commit to mattip/pandas that referenced this pull request Apr 3, 2017
- separate out groupby algorithms to separate lib
- release GIL on median
- release GIL on is_lexsorted / fix memory leak
- release GIL on nancorr

Author: Jeff Reback <[email protected]>

Closes pandas-dev#15775 from jreback/groupby and squashes the following commits:

4e2bfec [Jeff Reback] release GIL on median release GIL on is_lexsorted / fix memory leak release GIL on nancorr
ce28bb5 [Jeff Reback] CLN: separate out groupby algorithms to separate lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants