Skip to content

Commit 32ea126

Browse files
committed
fixes Incompatible types in assignment (array - list)
1 parent 141b503 commit 32ea126

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ramanchada2/misc/utils/matchsets.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)