@@ -39,7 +39,7 @@ def _nnmark(I):
3939 I [idx ] = idx
4040
4141 k = I .shape [0 ]
42- i = np .arange (k )
42+ i = np .arange (k , dtype = np . int64 )
4343
4444 nnmark = np .bincount (np .minimum (i , I ), minlength = k )
4545 nnmark -= np .bincount (np .maximum (i , I ), minlength = k )
@@ -86,15 +86,15 @@ def _iac(
8686 """
8787 np .random .seed (seed )
8888
89- I = np .random .randint (0 , width , size = width )
89+ I = np .random .randint (0 , width , size = width , dtype = np . int64 )
9090 if bidirectional is False : # Idealized 1-dimensional matrix profile index
9191 I [:- 1 ] = width
9292 for i in range (width - 1 ):
93- I [i ] = np .random .randint (i + 1 , width )
93+ I [i ] = np .random .randint (i + 1 , width , dtype = np . int64 )
9494
9595 target_AC = _nnmark (I )
9696
97- params = np .empty ((n_iter , 2 ))
97+ params = np .empty ((n_iter , 2 ), dtype = np . float64 )
9898 for i in range (n_iter ):
9999 hist_dist = scipy .stats .rv_histogram (
100100 (target_AC , np .append (np .arange (width ), width ))
@@ -164,7 +164,7 @@ def _cac(I, L, bidirectional=True, excl_factor=5, custom_iac=None, seed=0):
164164 """
165165 k = I .shape [0 ]
166166 AC = _nnmark (I )
167- CAC = np .zeros (k )
167+ CAC = np .zeros (k , dtype = np . float64 )
168168
169169 if custom_iac is None :
170170 IAC = _iac (k , bidirectional , seed = seed )
@@ -218,7 +218,7 @@ def _rea(cac, n_regimes, L, excl_factor=5):
218218
219219 This is the implementation for the regime extracting algorithm (REA).
220220 """
221- regime_locs = np .empty (n_regimes - 1 , dtype = np .int )
221+ regime_locs = np .empty (n_regimes - 1 , dtype = np .int64 )
222222 tmp_cac = copy .deepcopy (cac )
223223 for i in range (n_regimes - 1 ):
224224 regime_locs [i ] = np .argmin (tmp_cac )
@@ -483,7 +483,7 @@ def __init__(
483483 n_samples = self ._n_samples ,
484484 )
485485
486- right_nn = np .zeros ((self ._k , self ._m ))
486+ right_nn = np .zeros ((self ._k , self ._m ), dtype = np . float64 )
487487
488488 # Disable the bidirectional matrix profile indices and left indices
489489 self ._mp [:, 1 ] = - 1
@@ -492,7 +492,10 @@ def __init__(
492492 # Update matrix profile distance to be right mp distance and not bidirectional.
493493 # Use right indices to perform direct distance calculations
494494 # Note that any -1 indices must have a np.inf matrix profile value
495- right_indices = [np .arange (IR , IR + self ._m ) for IR in self ._mp [:, 3 ].tolist ()]
495+ right_indices = [
496+ np .arange (IR , IR + self ._m , dtype = np .int64 )
497+ for IR in self ._mp [:, 3 ].tolist ()
498+ ]
496499 right_nn [:] = self ._T [np .array (right_indices )]
497500 if self ._normalize :
498501 self ._mp [:, 0 ] = np .linalg .norm (
@@ -509,7 +512,7 @@ def __init__(
509512 self ._mp [inf_indices , 0 ] = np .inf
510513 self ._mp [inf_indices , 3 ] = inf_indices
511514
512- self ._cac = np .ones (self ._k ) * - 1
515+ self ._cac = np .ones (self ._k , dtype = np . float64 ) * - 1
513516
514517 def update (self , t ):
515518 """
0 commit comments