NeuralAnalysis / PyalData

Repository for the Python implementation of the TrialData analysis library.
GNU General Public License v3.0
7 stars 9 forks source link

Index error for `utils.slice_between_points` when using last time step #103

Closed JoannaChang closed 2 years ago

JoannaChang commented 3 years ago

If the end_point_name for restrict_to_interval or slice_between_points is the last time point of the trial (e.g. 'idx_trial_end'), then there is an error for slicing

slice(trial[start_point_name]-before, trial[end_point_name]+after+1)

since the index trial[end_point_name]+1 does not exist.

bagibence commented 3 years ago

Sorry for not addressing this earlier. Is this still an issue? I tried replicating the problem but it seems to work for me:

Screenshot 2021-09-16 at 09 58 03