-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
REF: use fused types for groupby_helper #28886
Conversation
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.
lgtm. whitespace comment.
pandas/_libs/groupby_helper.pxi.in
Outdated
@@ -548,9 +600,10 @@ def group_cummin(groupby_t[:, :] out, | |||
def group_cummax(groupby_t[:, :] out, | |||
groupby_t[:, :] values, | |||
const int64_t[:] labels, | |||
int ngroups, | |||
int ngroups, |
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.
weird indenting?
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.
Looks like it was tabs, just fixed
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.
OK sounds good. I'd still prefer to keep as is and just add the uint
template generation as required until 0.30 gets released, but am not strongly enough opposed to block if others like this
group_rank_float64 = group_rank["float64_t"] | ||
group_rank_float32 = group_rank["float32_t"] | ||
group_rank_int64 = group_rank["int64_t"] | ||
# Note: we do not have a group_rank_object because that would require a |
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.
FWIW I don't think we really even want this #19560
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.
OK. The comment seemed appropriate since we are using the same fused type. Could add a reference to 19560 in the comment?
for i in range(ncounts): | ||
for j in range(K): | ||
if nobs[i, j] == 0: | ||
if rank_t is int64_t: |
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.
Do you see any harm in putting this condition in the object block as well? Not sure if this is covered by tests but could see someone mistakenly assuming that the gil and nogil blocks are identical when 0.30 gets released and missing this on refactor
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 like this idea, will do
Since we're probably going to wait for a while after 0.30 is released before bumping ourselves, that is longer than I'd prefer. As for using uint template generation in the interim, I did that before deciding that I am much more likely to screw up using tempita than I am using fused types. |
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.
lgtm @jreback
thanks @jbrockmendel we cannot wait for deps, who knows when they land |
There will be some nice cleanups we can do after we bump cython to 0.30 (which hasnt come out yet).
Also I think there is some na-checking code that we can share between the various fused-types functions after this.