@@ -124,7 +124,7 @@ def group_median_float64(
124124 ndarray[intp_t] indexer
125125 float64_t* ptr
126126
127- assert min_count == -1, "'min_count' only used in add and prod"
127+ assert min_count == -1, "'min_count' only used in sum and prod"
128128
129129 ngroups = len (counts)
130130 N , K = (< object > values).shape
@@ -502,7 +502,7 @@ def group_any_all(
502502
503503
504504# ----------------------------------------------------------------------
505- # group_add , group_prod, group_var, group_mean, group_ohlc
505+ # group_sum , group_prod, group_var, group_mean, group_ohlc
506506# ----------------------------------------------------------------------
507507
508508ctypedef fused mean_t:
@@ -511,17 +511,17 @@ ctypedef fused mean_t:
511511 complex64_t
512512 complex128_t
513513
514- ctypedef fused add_t :
514+ ctypedef fused sum_t :
515515 mean_t
516516 object
517517
518518
519519@ cython.wraparound (False )
520520@ cython.boundscheck (False )
521- def group_add (
522- add_t [:, ::1] out ,
521+ def group_sum (
522+ sum_t [:, ::1] out ,
523523 int64_t[::1] counts ,
524- ndarray[add_t , ndim = 2 ] values,
524+ ndarray[sum_t , ndim = 2 ] values,
525525 const intp_t[::1] labels ,
526526 Py_ssize_t min_count = 0 ,
527527 bint is_datetimelike = False ,
@@ -531,8 +531,8 @@ def group_add(
531531 """
532532 cdef:
533533 Py_ssize_t i , j , N , K , lab , ncounts = len (counts)
534- add_t val , t , y
535- add_t [:, ::1] sumx , compensation
534+ sum_t val , t , y
535+ sum_t [:, ::1] sumx , compensation
536536 int64_t[:, ::1] nobs
537537 Py_ssize_t len_values = len (values), len_labels = len (labels)
538538
@@ -546,7 +546,7 @@ def group_add(
546546
547547 N , K = (< object > values).shape
548548
549- if add_t is object:
549+ if sum_t is object:
550550 # NB: this does not use 'compensation' like the non-object track does.
551551 for i in range(N ):
552552 lab = labels[i]
@@ -588,10 +588,10 @@ def group_add(
588588
589589 # not nan
590590 # With dt64/td64 values, values have been cast to float64
591- # instead if int64 for group_add , but the logic
591+ # instead if int64 for group_sum , but the logic
592592 # is otherwise the same as in _treat_as_na
593593 if val == val and not (
594- add_t is float64_t
594+ sum_t is float64_t
595595 and is_datetimelike
596596 and val == < float64_t> NPY_NAT
597597 ):
@@ -677,7 +677,7 @@ def group_var(
677677 int64_t[:, ::1] nobs
678678 Py_ssize_t len_values = len (values), len_labels = len (labels)
679679
680- assert min_count == -1, "'min_count' only used in add and prod"
680+ assert min_count == -1, "'min_count' only used in sum and prod"
681681
682682 if len_values != len_labels:
683683 raise ValueError("len(index ) != len(labels )")
@@ -745,7 +745,7 @@ def group_mean(
745745 Array containing unique label for each group , with its
746746 ordering matching up to the corresponding record in `values`.
747747 min_count : Py_ssize_t
748- Only used in add and prod. Always -1.
748+ Only used in sum and prod. Always -1.
749749 is_datetimelike : bool
750750 True if `values` contains datetime-like entries.
751751 mask : ndarray[bool , ndim = 2 ], optional
@@ -766,7 +766,7 @@ def group_mean(
766766 int64_t[:, ::1] nobs
767767 Py_ssize_t len_values = len (values), len_labels = len (labels)
768768
769- assert min_count == -1, "'min_count' only used in add and prod"
769+ assert min_count == -1, "'min_count' only used in sum and prod"
770770
771771 if len_values != len_labels:
772772 raise ValueError("len(index ) != len(labels )")
@@ -821,7 +821,7 @@ def group_ohlc(
821821 Py_ssize_t i , j , N , K , lab
822822 floating val
823823
824- assert min_count == -1, "'min_count' only used in add and prod"
824+ assert min_count == -1, "'min_count' only used in sum and prod"
825825
826826 if len(labels ) == 0:
827827 return
0 commit comments