Skip to content

Commit

Permalink
add an additional check
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Jul 8, 2024
1 parent 37d5d5e commit 78568fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/depiction/spectrum/peak_picking/basic_peak_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def get_min_distance_indices(
if min_distance is None:
return None
elif min_distance_unit == "index":
return min_distance
if round(min_distance) != min_distance:
raise ValueError("min_distance must be an integer when using 'index' units.")
return int(min_distance)
elif min_distance_unit == "mz":
# convert the distance into indices
med_distance = np.median(np.diff(mz_arr))
Expand Down

0 comments on commit 78568fc

Please sign in to comment.