python-neo icon indicating copy to clipboard operation
python-neo copied to clipboard

[Feature] Make neo.core.Epoch more useful

Open morales-gregorio opened this issue 4 years ago • 1 comments

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 with epc[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

morales-gregorio avatar Jun 19 '20 16:06 morales-gregorio

Hohey again!

Some further improvements could also include:

  • epoch.t_stop is equal to epoch.times[-1], but for me it would make much more sense if it would be epoch.times[-1] + epoch.durations[-1]
  • epoch.time_slice() acts only on the epoch.times, but in my opinion it should also crop the epoch.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

morales-gregorio avatar Jul 06 '20 09:07 morales-gregorio