MCPcopy
hub / github.com/mne-tools/mne-python / _sort

Method _sort

mne/annotations.py:737–748  ·  view source on GitHub ↗

Sort in place.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers 3

__init__Method · 0.95
appendMethod · 0.95
_sortMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected