1414
1515from multiprocessing import Pool , cpu_count
1616from scipy import ndimage
17- from future .utils import native_str
1817
1918from eqcorrscan .utils .correlate import pool_boy
2019from eqcorrscan .utils .libnames import _load_cdll
@@ -344,17 +343,17 @@ def _multi_decluster(peaks, indices, trig_int, thresholds, cores):
344343
345344 func .argtypes = [
346345 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (total_length ,),
347- flags = native_str ( 'C_CONTIGUOUS' ) ),
346+ flags = 'C_CONTIGUOUS' ),
348347 np .ctypeslib .ndpointer (dtype = long_type , shape = (total_length ,),
349- flags = native_str ( 'C_CONTIGUOUS' ) ),
348+ flags = 'C_CONTIGUOUS' ),
350349 np .ctypeslib .ndpointer (dtype = long_type , shape = (n ,),
351- flags = native_str ( 'C_CONTIGUOUS' ) ),
350+ flags = 'C_CONTIGUOUS' ),
352351 ctypes .c_int ,
353352 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (n ,),
354- flags = native_str ( 'C_CONTIGUOUS' ) ),
353+ flags = 'C_CONTIGUOUS' ),
355354 long_type ,
356355 np .ctypeslib .ndpointer (dtype = np .uint32 , shape = (total_length ,),
357- flags = native_str ( 'C_CONTIGUOUS' ) ),
356+ flags = 'C_CONTIGUOUS' ),
358357 ctypes .c_int ]
359358 func .restype = ctypes .c_int
360359
@@ -440,14 +439,14 @@ def decluster_distance_time(peaks, index, trig_int, catalog,
440439
441440 func .argtypes = [
442441 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (length ,),
443- flags = native_str ( 'C_CONTIGUOUS' ) ),
442+ flags = 'C_CONTIGUOUS' ),
444443 np .ctypeslib .ndpointer (dtype = long_type , shape = (length ,),
445- flags = native_str ( 'C_CONTIGUOUS' ) ),
444+ flags = 'C_CONTIGUOUS' ),
446445 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (length * length ,),
447- flags = native_str ( 'C_CONTIGUOUS' ) ),
446+ flags = 'C_CONTIGUOUS' ),
448447 long_type , ctypes .c_float , long_type , ctypes .c_float ,
449448 np .ctypeslib .ndpointer (dtype = np .uint32 , shape = (length ,),
450- flags = native_str ( 'C_CONTIGUOUS' ) )]
449+ flags = 'C_CONTIGUOUS' )]
451450 func .restype = ctypes .c_int
452451
453452 sorted_inds = np .abs (peaks ).argsort ()
@@ -505,12 +504,12 @@ def decluster(peaks, index, trig_int, threshold=0):
505504
506505 func .argtypes = [
507506 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (length ,),
508- flags = native_str ( 'C_CONTIGUOUS' ) ),
507+ flags = 'C_CONTIGUOUS' ),
509508 np .ctypeslib .ndpointer (dtype = long_type , shape = (length ,),
510- flags = native_str ( 'C_CONTIGUOUS' ) ),
509+ flags = 'C_CONTIGUOUS' ),
511510 long_type , ctypes .c_float , long_type ,
512511 np .ctypeslib .ndpointer (dtype = np .uint32 , shape = (length ,),
513- flags = native_str ( 'C_CONTIGUOUS' ) )]
512+ flags = 'C_CONTIGUOUS' )]
514513 func .restype = ctypes .c_int
515514
516515 sorted_inds = np .abs (peaks ).argsort ()
@@ -539,10 +538,10 @@ def _find_peaks_c(array, threshold):
539538 length = array .shape [0 ]
540539 utilslib .find_peaks .argtypes = [
541540 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (length , ),
542- flags = native_str ( 'C_CONTIGUOUS' ) ),
541+ flags = 'C_CONTIGUOUS' ),
543542 ctypes .c_long , ctypes .c_float ,
544543 np .ctypeslib .ndpointer (dtype = np .uint32 , shape = (length , ),
545- flags = native_str ( 'C_CONTIGUOUS' ) )]
544+ flags = 'C_CONTIGUOUS' )]
546545 utilslib .find_peaks .restype = ctypes .c_int
547546 arr = np .ascontiguousarray (array , np .float32 )
548547 out = np .ascontiguousarray (np .zeros ((length , ), dtype = np .uint32 ))
@@ -567,13 +566,13 @@ def _multi_find_peaks_c(arrays, thresholds, threads):
567566 arr = np .ascontiguousarray (arrays .flatten (), np .float32 )
568567 utilslib .multi_find_peaks .argtypes = [
569568 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (n * length ,),
570- flags = native_str ( 'C_CONTIGUOUS' ) ),
569+ flags = 'C_CONTIGUOUS' ),
571570 ctypes .c_long , ctypes .c_int ,
572571 np .ctypeslib .ndpointer (dtype = np .float32 , shape = (n , ),
573- flags = native_str ( 'C_CONTIGUOUS' ) ),
572+ flags = 'C_CONTIGUOUS' ),
574573 ctypes .c_int ,
575574 np .ctypeslib .ndpointer (dtype = np .uint32 , shape = (n * length , ),
576- flags = native_str ( 'C_CONTIGUOUS' ) )]
575+ flags = 'C_CONTIGUOUS' )]
577576 utilslib .multi_find_peaks .restype = ctypes .c_int
578577
579578 out = np .ascontiguousarray (np .zeros ((n * length , ), dtype = np .uint32 ))
0 commit comments