Skip to content

Commit 3c6444b

Browse files
committed
get_stop_time -> get_end_time and fix tests
1 parent 4f5024a commit 3c6444b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/spikeinterface/core/baserecording.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def get_duration(self, segment_index=None) -> float:
233233
The duration in seconds
234234
"""
235235
segment_duration = (
236-
self.get_stop_time(segment_index) - self.get_start_time(segment_index) + (1 / self.get_sampling_frequency())
236+
self.get_end_time(segment_index) - self.get_start_time(segment_index) + (1 / self.get_sampling_frequency())
237237
)
238238
return segment_duration
239239

@@ -456,7 +456,7 @@ def get_start_time(self, segment_index=None) -> float:
456456
rs = self._recording_segments[segment_index]
457457
return rs.get_start_time()
458458

459-
def get_stop_time(self, segment_index=None) -> float:
459+
def get_end_time(self, segment_index=None) -> float:
460460
"""Get the stop time of the recording segment.
461461
462462
Parameters
@@ -471,7 +471,7 @@ def get_stop_time(self, segment_index=None) -> float:
471471
"""
472472
segment_index = self._check_segment_index(segment_index)
473473
rs = self._recording_segments[segment_index]
474-
return rs.get_stop_time()
474+
return rs.get_end_time()
475475

476476
def has_time_vector(self, segment_index=None):
477477
"""Check if the segment of the recording has a time vector.
@@ -937,11 +937,11 @@ def get_start_time(self) -> float:
937937
else:
938938
return self.t_start if self.t_start is not None else 0.0
939939

940-
def get_stop_time(self) -> float:
940+
def get_end_time(self) -> float:
941941
if self.time_vector is not None:
942942
return self.time_vector[-1]
943943
else:
944-
t_stop = self.get_num_samples() / self.sampling_frequency
944+
t_stop = (self.get_num_samples() - 1) / self.sampling_frequency
945945
if self.t_start is not None:
946946
t_stop += self.t_start
947947
return t_stop

0 commit comments

Comments
 (0)