File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -4223,13 +4223,14 @@ def read_segment(self, episode):
42234223 # each channel in the episode
42244224 for channel in range (1 , self .elphy_file .n_channels (episode ) + 1 ):
42254225 signal = self .elphy_file .get_signal (episode , channel )
4226+ x_unit = signal .x_unit .strip ().decode ()
42264227 analog_signal = AnalogSignal (
42274228 signal .data ['y' ],
42284229 units = signal .y_unit ,
42294230 t_start = signal .t_start * getattr (pq , signal .x_unit .strip ().decode ()),
42304231 t_stop = signal .t_stop * getattr (pq , signal .x_unit .strip ().decode ()),
42314232 # sampling_rate = signal.sampling_frequency * pq.kHz,
4232- sampling_period = signal .sampling_period * getattr (pq , signal . x_unit . strip (). decode () ),
4233+ sampling_period = signal .sampling_period * getattr (pq , x_unit ),
42334234 channel_name = "episode {}, channel {}" .format (int (episode + 1 ), int (channel + 1 ))
42344235 )
42354236 analog_signal .segment = segment
Original file line number Diff line number Diff line change @@ -28,5 +28,6 @@ def test_read_data(self):
2828 # ensure that at least one data object is generated for each file
2929 self .assertTrue (any (list (bl .segments [0 ].size .values ())))
3030
31+
3132if __name__ == "__main__" :
32- unittest .main ()
33+ unittest .main ()
You can’t perform that action at this time.
0 commit comments