You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we do this, then we should make sure there is extend in addition to append. I automate annotation of infant data, marking segments of fast movement as bad. There can be thousands of tiny segments like this per file, and so calling sort over and over again will incur a worsening penalty as the number grows. (Though using searchsorted with assume_sorted=True might be reasonable.)
We could also add a sort=True kwarg but this seems less clean than just always sorting and adding an extend method, if we don't have it.
Activity
massich commentedon Jan 23, 2019
If we have a sorting method, we should used in places like this (there are more):
mne-python/mne/viz/utils.py
Lines 1913 to 1914 in e96d706
The other option it would be to actually keep annotations always sorted by onset, and use
numpy.searchsortedinappendand_combine_annotationsmmagnuski commentedon Jan 24, 2019
I'd be +1 for always sorting, but I'm also ok with
annotations.sort().agramfort commentedon Jan 25, 2019
larsoner commentedon Jan 25, 2019
If we do this, then we should make sure there is extend in addition to append. I automate annotation of infant data, marking segments of fast movement as bad. There can be thousands of tiny segments like this per file, and so calling sort over and over again will incur a worsening penalty as the number grows. (Though using searchsorted with assume_sorted=True might be reasonable.)
We could also add a
sort=Truekwarg but this seems less clean than just always sorting and adding an extend method, if we don't have it.cbrnr commentedon Jan 25, 2019
+1 for always sorting and adding an extend method. As tie breakers I suggest that we use description and then duration.
larsoner commentedon Jan 29, 2019
It looks like
appendalready hasextend-like behavior, so we can just update the docstring.