Skip to content

Commit

Permalink
Fix telescope grouping for uint telescope id
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Feb 4, 2025
1 parent 14cb49a commit 7fe9778
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ctapipe/instrument/subarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _group_consecutives(sequence):
from https://codereview.stackexchange.com/questions/214820/codewars-range-extraction
"""
sequence = sorted(sequence)
for _, g in groupby(enumerate(sequence), lambda i_x: i_x[0] - i_x[1]):
for _, g in groupby(enumerate(sequence), lambda i_x: int(i_x[0]) - int(i_x[1])):
r = [x for _, x in g]
if len(r) > 2:
yield f"{r[0]}-{r[-1]}"
Expand Down

0 comments on commit 7fe9778

Please sign in to comment.