Skip to content

Commit 27360da

Browse files
committed
Extending sorting_analyzer 'get_total_duration' to use recording if available.
1 parent f95c22a commit 27360da

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/spikeinterface/core/sortinganalyzer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,10 @@ def get_total_samples(self) -> int:
821821
return s
822822

823823
def get_total_duration(self) -> float:
824-
duration = self.get_total_samples() / self.sampling_frequency
824+
if self.has_recording() or self.has_temporary_recording():
825+
duration = self.recording.get_total_duration()
826+
else:
827+
duration = self.get_total_samples() / self.sampling_frequency
825828
return duration
826829

827830
def get_num_channels(self) -> int:

0 commit comments

Comments
 (0)