PyTrack icon indicating copy to clipboard operation
PyTrack copied to clipboard

Fix IndexError when data has a single blink occurring at the start of the sequence

Open TrevorChartier opened this issue 7 months ago • 0 comments

Previously, if the data contained only one blink, and the blink occured at the start of the sequence (ie. pupil size is -1 for first index), blink onset would be empty, but length_blinks would be greater than zero because blink offset would not be empty. This would cause an IndexError when attempting to access blink_onset[0]. This change adds a guard clause to handle this edge case and prevent the error.

TrevorChartier avatar Jun 15 '25 16:06 TrevorChartier