@@ -29,10 +29,10 @@ def get_dispatch(dtypes):
2929
3030@cython.wraparound(False)
3131@cython.boundscheck(False)
32- def group_add_{{name}}(ndarray[ {{c_type}}, ndim=2 ] out,
33- ndarray[ int64_t] counts,
34- ndarray[ {{c_type}}, ndim=2 ] values,
35- ndarray[ int64_t] labels,
32+ def group_add_{{name}}({{c_type}}[:, : ] out,
33+ int64_t[: ] counts,
34+ {{c_type}}[:, : ] values,
35+ const int64_t[: ] labels,
3636 Py_ssize_t min_count=0):
3737 """
3838 Only aggregates on axis=0
@@ -76,10 +76,10 @@ def group_add_{{name}}(ndarray[{{c_type}}, ndim=2] out,
7676
7777@cython.wraparound(False)
7878@cython.boundscheck(False)
79- def group_prod_{{name}}(ndarray[ {{c_type}}, ndim=2 ] out,
80- ndarray[ int64_t] counts,
81- ndarray[ {{c_type}}, ndim=2 ] values,
82- ndarray[ int64_t] labels,
79+ def group_prod_{{name}}({{c_type}}[:, : ] out,
80+ int64_t[: ] counts,
81+ {{c_type}}[:, : ] values,
82+ const int64_t[: ] labels,
8383 Py_ssize_t min_count=0):
8484 """
8585 Only aggregates on axis=0
@@ -123,10 +123,10 @@ def group_prod_{{name}}(ndarray[{{c_type}}, ndim=2] out,
123123@cython.wraparound(False)
124124@cython.boundscheck(False)
125125@cython.cdivision(True)
126- def group_var_{{name}}(ndarray[ {{c_type}}, ndim=2 ] out,
127- ndarray[ int64_t] counts,
128- ndarray[ {{c_type}}, ndim=2 ] values,
129- ndarray[ int64_t] labels,
126+ def group_var_{{name}}({{c_type}}[:, : ] out,
127+ int64_t[: ] counts,
128+ {{c_type}}[:, : ] values,
129+ const int64_t[: ] labels,
130130 Py_ssize_t min_count=-1):
131131 cdef:
132132 Py_ssize_t i, j, N, K, lab, ncounts = len(counts)
@@ -175,10 +175,10 @@ def group_var_{{name}}(ndarray[{{c_type}}, ndim=2] out,
175175
176176@cython.wraparound(False)
177177@cython.boundscheck(False)
178- def group_mean_{{name}}(ndarray[ {{c_type}}, ndim=2 ] out,
179- ndarray[ int64_t] counts,
180- ndarray[ {{c_type}}, ndim=2 ] values,
181- ndarray[ int64_t] labels,
178+ def group_mean_{{name}}({{c_type}}[:, : ] out,
179+ int64_t[: ] counts,
180+ {{c_type}}[:, : ] values,
181+ const int64_t[: ] labels,
182182 Py_ssize_t min_count=-1):
183183 cdef:
184184 Py_ssize_t i, j, N, K, lab, ncounts = len(counts)
@@ -220,11 +220,11 @@ def group_mean_{{name}}(ndarray[{{c_type}}, ndim=2] out,
220220
221221@cython.wraparound(False)
222222@cython.boundscheck(False)
223- def group_ohlc_{{name}}(ndarray[ {{c_type}}, ndim=2 ] out,
224- ndarray[ int64_t] counts,
225- ndarray[ {{c_type}}, ndim=2 ] values,
226- ndarray[ int64_t] labels,
227- Py_ssize_t min_count=-1):
223+ def group_ohlc_{{name}}({{c_type}}[:, : ] out,
224+ int64_t[: ] counts,
225+ {{c_type}}[:, : ] values,
226+ const int64_t[: ] labels,
227+ Py_ssize_t min_count=-1):
228228 """
229229 Only aggregates on axis=0
230230 """
@@ -293,10 +293,10 @@ def get_dispatch(dtypes):
293293
294294@cython.wraparound(False)
295295@cython.boundscheck(False)
296- def group_last_{{name}}(ndarray[ {{c_type}}, ndim=2 ] out,
297- ndarray[ int64_t] counts,
298- ndarray[ {{c_type}}, ndim=2 ] values,
299- ndarray[ int64_t] labels,
296+ def group_last_{{name}}({{c_type}}[:, : ] out,
297+ int64_t[: ] counts,
298+ {{c_type}}[:, : ] values,
299+ const int64_t[: ] labels,
300300 Py_ssize_t min_count=-1):
301301 """
302302 Only aggregates on axis=0
@@ -350,10 +350,10 @@ def group_last_{{name}}(ndarray[{{c_type}}, ndim=2] out,
350350
351351@cython.wraparound(False)
352352@cython.boundscheck(False)
353- def group_nth_{{name}}(ndarray[ {{c_type}}, ndim=2 ] out,
354- ndarray[ int64_t] counts,
355- ndarray[ {{c_type}}, ndim=2 ] values,
356- ndarray[ int64_t] labels, int64_t rank,
353+ def group_nth_{{name}}({{c_type}}[:, : ] out,
354+ int64_t[: ] counts,
355+ {{c_type}}[:, : ] values,
356+ const int64_t[: ] labels, int64_t rank,
357357 Py_ssize_t min_count=-1):
358358 """
359359 Only aggregates on axis=0
@@ -411,9 +411,9 @@ def group_nth_{{name}}(ndarray[{{c_type}}, ndim=2] out,
411411
412412@cython.boundscheck(False)
413413@cython.wraparound(False)
414- def group_rank_{{name}}(ndarray[ float64_t, ndim=2 ] out,
415- ndarray[ {{c_type}}, ndim=2 ] values,
416- ndarray[ int64_t] labels,
414+ def group_rank_{{name}}(float64_t[:, : ] out,
415+ {{c_type}}[:, : ] values,
416+ const int64_t[: ] labels,
417417 bint is_datetimelike, object ties_method,
418418 bint ascending, bint pct, object na_option):
419419 """
@@ -606,10 +606,10 @@ ctypedef fused groupby_t:
606606
607607@cython.wraparound(False)
608608@cython.boundscheck(False)
609- def group_max(ndarray[ groupby_t, ndim=2 ] out,
610- ndarray[ int64_t] counts,
611- ndarray[ groupby_t, ndim=2 ] values,
612- ndarray[ int64_t] labels,
609+ def group_max(groupby_t[:, : ] out,
610+ int64_t[: ] counts,
611+ groupby_t[:, : ] values,
612+ const int64_t[: ] labels,
613613 Py_ssize_t min_count=-1):
614614 """
615615 Only aggregates on axis=0
@@ -669,10 +669,10 @@ def group_max(ndarray[groupby_t, ndim=2] out,
669669
670670@cython.wraparound(False)
671671@cython.boundscheck(False)
672- def group_min(ndarray[ groupby_t, ndim=2 ] out,
673- ndarray[ int64_t] counts,
674- ndarray[ groupby_t, ndim=2 ] values,
675- ndarray[ int64_t] labels,
672+ def group_min(groupby_t[:, : ] out,
673+ int64_t[: ] counts,
674+ groupby_t[:, : ] values,
675+ const int64_t[: ] labels,
676676 Py_ssize_t min_count=-1):
677677 """
678678 Only aggregates on axis=0
@@ -731,9 +731,9 @@ def group_min(ndarray[groupby_t, ndim=2] out,
731731
732732@cython.boundscheck(False)
733733@cython.wraparound(False)
734- def group_cummin(ndarray[ groupby_t, ndim=2 ] out,
735- ndarray[ groupby_t, ndim=2 ] values,
736- ndarray[ int64_t] labels,
734+ def group_cummin(groupby_t[:, : ] out,
735+ groupby_t[:, : ] values,
736+ const int64_t[: ] labels,
737737 bint is_datetimelike):
738738 """
739739 Only transforms on axis=0
@@ -779,9 +779,9 @@ def group_cummin(ndarray[groupby_t, ndim=2] out,
779779
780780@cython.boundscheck(False)
781781@cython.wraparound(False)
782- def group_cummax(ndarray[ groupby_t, ndim=2 ] out,
783- ndarray[ groupby_t, ndim=2 ] values,
784- ndarray[ int64_t] labels,
782+ def group_cummax(groupby_t[:, : ] out,
783+ groupby_t[:, : ] values,
784+ const int64_t[: ] labels,
785785 bint is_datetimelike):
786786 """
787787 Only transforms on axis=0
0 commit comments