Skip to content
Snippets Groups Projects
Commit d905033c authored by Zineb Aly's avatar Zineb Aly
Browse files

adapt best_track to sliced tracks

parent a574d924
No related branches found
No related tags found
No related merge requests found
Pipeline #14139 passed with warnings
......@@ -302,7 +302,11 @@ def best_track(tracks, strategy="default", rec_type=None):
if strategy not in options:
raise ValueError("{} not in {}".format(strategy, options))
n_events = len(tracks)
try:
n_events = len(count_nested(tracks.lik, axis=1))
except ValueError:
n_events = 1
if n_events > 1 and any(count_nested(tracks.lik, axis=1) == 0):
raise ValueError(
"'events' should not contain empty tracks. Consider applying the mask: events.n_tracks>0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment