@@ -351,7 +351,7 @@ def nancorr(const float64_t[:, :] mat, bint cov=False, minp=None):
351351 Py_ssize_t i, xi, yi, N, K
352352 int64_t minpv
353353 float64_t[:, ::1 ] result
354- ndarray[ uint8_t, ndim = 2 ] mask
354+ uint8_t[:, : ] mask
355355 int64_t nobs = 0
356356 float64_t vx, vy, dx, dy, meanx, meany, divisor, ssqdmx, ssqdmy, covxy
357357
@@ -407,7 +407,7 @@ def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1) -> ndarr
407407 Py_ssize_t i , xi , yi , N , K
408408 ndarray[float64_t , ndim = 2 ] result
409409 ndarray[float64_t , ndim = 2 ] ranked_mat
410- ndarray[ float64_t , ndim = 1 ] rankedx, rankedy
410+ float64_t[:: 1] rankedx , rankedy
411411 float64_t[::1] maskedx , maskedy
412412 ndarray[uint8_t , ndim = 2 ] mask
413413 int64_t nobs = 0
@@ -566,8 +566,8 @@ def get_fill_indexer(const uint8_t[:] mask, limit=None):
566566@ cython.boundscheck (False )
567567@ cython.wraparound (False )
568568def pad (
569- ndarray[ numeric_object_t] old ,
570- ndarray[ numeric_object_t] new ,
569+ const numeric_object_t[: ] old ,
570+ const numeric_object_t[: ] new ,
571571 limit = None
572572) -> ndarray:
573573 # -> ndarray[intp_t , ndim = 1 ]
@@ -691,8 +691,8 @@ def pad_2d_inplace(numeric_object_t[:, :] values, uint8_t[:, :] mask, limit=None
691691@ cython.boundscheck (False )
692692@ cython.wraparound (False )
693693def backfill (
694- ndarray[ numeric_object_t] old ,
695- ndarray[ numeric_object_t] new ,
694+ const numeric_object_t[: ] old ,
695+ const numeric_object_t[: ] new ,
696696 limit = None
697697) -> ndarray: # -> ndarray[intp_t , ndim = 1 ]
698698 """
@@ -786,7 +786,7 @@ def backfill_2d_inplace(numeric_object_t[:, :] values,
786786
787787@ cython.boundscheck (False )
788788@ cython.wraparound (False )
789- def is_monotonic (ndarray[ numeric_object_t , ndim = 1 ] arr, bint timelike ):
789+ def is_monotonic (const numeric_object_t[: ] arr , bint timelike ):
790790 """
791791 Returns
792792 -------
@@ -1089,8 +1089,7 @@ cdef void rank_sorted_1d(
10891089 float64_t[::1 ] out,
10901090 int64_t[::1 ] grp_sizes,
10911091 const intp_t[:] sort_indexer,
1092- # TODO(cython3): make const (https://github.com/cython/cython/issues/3222)
1093- numeric_object_t[:] masked_vals,
1092+ const numeric_object_t[:] masked_vals,
10941093 const uint8_t[:] mask,
10951094 bint check_mask,
10961095 Py_ssize_t N,
@@ -1378,16 +1377,15 @@ ctypedef fused out_t:
13781377@ cython.boundscheck (False )
13791378@ cython.wraparound (False )
13801379def diff_2d (
1381- ndarray[ diff_t , ndim = 2 ] arr, # TODO( cython3 ) update to " const diff_t[:, :] arr"
1380+ const diff_t[:, :] arr ,
13821381 ndarray[out_t , ndim = 2 ] out,
13831382 Py_ssize_t periods ,
13841383 int axis ,
13851384 bint datetimelike = False ,
13861385):
13871386 cdef:
13881387 Py_ssize_t i, j, sx, sy, start, stop
1389- bint f_contig = arr.flags.f_contiguous
1390- # bint f_contig = arr.is_f_contig() # TODO(cython3) once arr is memoryview
1388+ bint f_contig = arr.is_f_contig()
13911389 diff_t left, right
13921390
13931391 # Disable for unsupported dtype combinations,
0 commit comments