@@ -69,10 +69,10 @@ def match_peaks_cluster(
6969 # Extract cluster labels, x values, and y values
7070 df ["Cluster" ] = labels
7171 grouped = df .groupby ("Cluster" )
72- x_spe = np .array ([])
73- x_reference = np .array ([])
74- x_distance = np .array ([])
75- clusters = np .array ([])
72+ x_spe = np .array ([], dtype = float )
73+ x_reference = np .array ([], dtype = float )
74+ x_distance = np .array ([], dtype = float )
75+ clusters = np .array ([], dtype = float )
7676
7777 # Iterate through each group
7878 for cluster , group in grouped :
@@ -416,8 +416,8 @@ def match_peaks_monotonic_dynamic_programming(
416416 j -= 1
417417
418418 # Reverse because traceback goes from end
419- matched_ref = np .array (matched_ref [::- 1 ])
420- matched_spe = np .array (matched_spe [::- 1 ])
419+ matched_ref = np .array (matched_ref [::- 1 ], dtype = float )
420+ matched_spe = np .array (matched_spe [::- 1 ], dtype = float )
421421 distances = matched_spe - matched_ref
422422
423423 # Compute intensity differences
@@ -458,7 +458,7 @@ def match_peaks_monotonic(
458458 spe_int = np .array ([spe_pos_dict [k ] for k in sorted (spe_pos_dict .keys ())], dtype = float )
459459
460460 if len (ref_peaks ) == 0 or len (spe_peaks ) == 0 :
461- return np .array ([]), np .array ([]), np .array ([]), pd .DataFrame ()
461+ return np .array ([], dtype = float ), np .array ([], dtype = float ), np .array ([], dtype = float ), pd .DataFrame ()
462462
463463 # default tolerance
464464 if tolerance is None :
0 commit comments