1e882d05cab139530b2859bf4940c681f5b4b5e2,mne/viz/_brain/_timeviewer.py,_TimeViewer,play,#_TimeViewer#,422

Before Change


            delta = this_time - self._last_tick
            self._last_tick = time.time()
            time_data = self.brain._data["time"]
            times = np.arange(self.brain._n_times)
            time_shift = delta * self.playback_speed
            max_time = np.max(time_data)
            time_point = min(self.brain._current_time + time_shift, max_time)
            // always use linear here -- this does not determine the data
            // interpolation mode, it just finds where we are (in time) in
            // terms of the time indices
            idx = np.interp(time_point, time_data, times)
            self.time_call(idx, update_widget=True)
            if time_point == max_time:
                self.playback = False

After Change


    @safe_event
    def play(self):
        if self.playback:
            try:
                self._advance()
            except Exception:
                self.playback = False
                raise

    def _advance(self):
        this_time = time.time()
        delta = this_time - self._last_tick
        self._last_tick = time.time()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: mne-tools/mne-python
Commit Name: 1e882d05cab139530b2859bf4940c681f5b4b5e2
Time: 2020-03-27
Author: larson.eric.d@gmail.com
File Name: mne/viz/_brain/_timeviewer.py
Class Name: _TimeViewer
Method Name: play


Project Name: dPys/PyNets
Commit Name: f4a629a3b9437fafb882793f59014f6ce31e86aa
Time: 2018-07-18
Author: dpisner@utexas.edu
File Name: pynets/nodemaker.py
Class Name:
Method Name: RSN_fetch_nodes_and_labels


Project Name: dPys/PyNets
Commit Name: f4a629a3b9437fafb882793f59014f6ce31e86aa
Time: 2018-07-18
Author: dpisner@utexas.edu
File Name: pynets/nodemaker.py
Class Name:
Method Name: WB_fetch_nodes_and_labels