Skip to content

Commit

Permalink
change index shift to avoid error when synchrofacts occur in the last…
Browse files Browse the repository at this point in the history
… bin
  • Loading branch information
morales-gregorio committed Dec 26, 2023
1 parent e2df1b9 commit a8f15bd
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions elephant/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,13 +1548,8 @@ def _epoch_no_spread(self):
if self.sampling_rate:
# ensure that spikes are not on the bin edges
bin_shift = .5 / self.sampling_rate
left_edges -= bin_shift
left_edges += bin_shift

# Ensure that an epoch does not start before the minimum t_start.
# Note: all spike trains share the same t_start and t_stop.
if left_edges[0] < self.t_start:
left_edges[0] = self.t_start
durations[0] -= bin_shift
else:
warnings.warn('No sampling rate specified. '
'Note that using the complexity epoch to get '
Expand Down

0 comments on commit a8f15bd

Please sign in to comment.