@@ -351,7 +351,7 @@ def nancorr(const float64_t[:, :] mat, bint cov=False, minp=None):
351
351
Py_ssize_t i, xi, yi, N, K
352
352
int64_t minpv
353
353
float64_t[:, ::1 ] result
354
- ndarray[ uint8_t, ndim = 2 ] mask
354
+ uint8_t[:, : ] mask
355
355
int64_t nobs = 0
356
356
float64_t vx, vy, dx, dy, meanx, meany, divisor, ssqdmx, ssqdmy, covxy
357
357
@@ -407,7 +407,7 @@ def nancorr_spearman(ndarray[float64_t, ndim=2] mat, Py_ssize_t minp=1) -> ndarr
407
407
Py_ssize_t i , xi , yi , N , K
408
408
ndarray[float64_t , ndim = 2 ] result
409
409
ndarray[float64_t , ndim = 2 ] ranked_mat
410
- ndarray[ float64_t , ndim = 1 ] rankedx, rankedy
410
+ float64_t[:: 1] rankedx , rankedy
411
411
float64_t[::1] maskedx , maskedy
412
412
ndarray[uint8_t , ndim = 2 ] mask
413
413
int64_t nobs = 0
@@ -566,8 +566,8 @@ def get_fill_indexer(const uint8_t[:] mask, limit=None):
566
566
@ cython.boundscheck (False )
567
567
@ cython.wraparound (False )
568
568
def 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 ,
571
571
limit = None
572
572
) -> ndarray:
573
573
# -> ndarray[intp_t , ndim = 1 ]
@@ -691,8 +691,8 @@ def pad_2d_inplace(numeric_object_t[:, :] values, uint8_t[:, :] mask, limit=None
691
691
@ cython.boundscheck (False )
692
692
@ cython.wraparound (False )
693
693
def 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 ,
696
696
limit = None
697
697
) -> ndarray: # -> ndarray[intp_t , ndim = 1 ]
698
698
"""
@@ -786,7 +786,7 @@ def backfill_2d_inplace(numeric_object_t[:, :] values,
786
786
787
787
@ cython.boundscheck (False )
788
788
@ 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 ):
790
790
"""
791
791
Returns
792
792
-------
@@ -1089,8 +1089,7 @@ cdef void rank_sorted_1d(
1089
1089
float64_t[::1 ] out,
1090
1090
int64_t[::1 ] grp_sizes,
1091
1091
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,
1094
1093
const uint8_t[:] mask,
1095
1094
bint check_mask,
1096
1095
Py_ssize_t N,
@@ -1378,16 +1377,15 @@ ctypedef fused out_t:
1378
1377
@ cython.boundscheck (False )
1379
1378
@ cython.wraparound (False )
1380
1379
def diff_2d (
1381
- ndarray[ diff_t , ndim = 2 ] arr, # TODO( cython3 ) update to " const diff_t[:, :] arr"
1380
+ const diff_t[:, :] arr ,
1382
1381
ndarray[out_t , ndim = 2 ] out,
1383
1382
Py_ssize_t periods ,
1384
1383
int axis ,
1385
1384
bint datetimelike = False ,
1386
1385
):
1387
1386
cdef:
1388
1387
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()
1391
1389
diff_t left, right
1392
1390
1393
1391
# Disable for unsupported dtype combinations,
0 commit comments