python-neo
python-neo copied to clipboard
[Feature] Make neo.core.Epoch more useful
Hey!
I have been working with neo epoch for annotating behavioral states of a monkey and noticed that there are some few functionalities that would have made my life so much easier.
These are just some ideas:
- When I create an epoch with unsorted entries it would be nice that the epoch sorts them according to the
epoch.times
- It would be super useful to have some methods to check for:
- Gaps in between epoch entries
- Overlap between epoch entries
- It would be very useful so be able to merge consecutive entries (entries with
epc[0].labels == epc[1].labels
and withepc[0].times + epc[0].durations == epc[1].times
) into a single entry.
Right now these things can only be checked by 'manually' iterating over the times, durations and labels; which was quite error prone in my case.
I hope that you find some of these ideas worthy of discussion!
Cheers, Aitor
Hohey again!
Some further improvements could also include:
-
epoch.t_stop
is equal toepoch.times[-1]
, but for me it would make much more sense if it would beepoch.times[-1] + epoch.durations[-1]
-
epoch.time_slice()
acts only on theepoch.times
, but in my opinion it should also crop theepoch.durations[-1]
when necessary (following the t_stop criterion that I thought would make more sense).
Hope you find these ideas useful for the project :)
All best, Aitor