Sort in place.
(self)
| 735 | _write_annotations(fid, self) |
| 736 | |
| 737 | def _sort(self): |
| 738 | """Sort in place.""" |
| 739 | # instead of argsort here we use sorted so that it gives us |
| 740 | # the onset-then-duration hierarchy |
| 741 | vals = sorted(zip(self.onset, self.duration, range(len(self)))) |
| 742 | order = list(list(zip(*vals))[-1]) if len(vals) else [] |
| 743 | self.onset = self.onset[order] |
| 744 | self.duration = self.duration[order] |
| 745 | self.description = self.description[order] |
| 746 | self.ch_names = self.ch_names[order] |
| 747 | self.extras = [self.extras[i] for i in order] |
| 748 | return order |
| 749 | |
| 750 | def _get_crop_lims(self, tmin, tmax, use_orig_time): |
| 751 | """Compute absolute crop limits and offset.""" |