Skip to content

Commit

Permalink
Eliminate warning about setting timestamps in the ecephys stream (#1060)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin authored Sep 7, 2024
1 parent 1498a50 commit 81a022d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def set_aligned_timestamps(self, aligned_timestamps: np.ndarray):
self._number_of_segments == 1
), "This recording has multiple segments; please use 'align_segment_timestamps' instead."

self.recording_extractor.set_times(times=aligned_timestamps)
self.recording_extractor.set_times(times=aligned_timestamps, with_warning=False)

def set_aligned_segment_timestamps(self, aligned_segment_timestamps: list[np.ndarray]):
"""
Expand All @@ -172,7 +172,9 @@ def set_aligned_segment_timestamps(self, aligned_segment_timestamps: list[np.nda

for segment_index in range(self._number_of_segments):
self.recording_extractor.set_times(
times=aligned_segment_timestamps[segment_index], segment_index=segment_index
times=aligned_segment_timestamps[segment_index],
segment_index=segment_index,
with_warning=False,
)

def set_aligned_starting_time(self, aligned_starting_time: float):
Expand Down Expand Up @@ -285,7 +287,11 @@ def subset_recording(self, stub_test: bool = False):
for segment_index, end_frame in zip(range(number_of_segments), end_frame_list)
]
for segment_index in range(number_of_segments):
recording_extractor_stubbed.set_times(times=times_stubbed[segment_index], segment_index=segment_index)
recording_extractor_stubbed.set_times(
times=times_stubbed[segment_index],
segment_index=segment_index,
with_warning=False,
)

return recording_extractor_stubbed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def set_aligned_timestamps(self, aligned_timestamps: np.ndarray):
), "This recording has multiple segments; please use 'set_aligned_segment_timestamps' instead."

if self._number_of_segments == 1:
self.sorting_extractor._recording.set_times(times=aligned_timestamps)
self.sorting_extractor._recording.set_times(times=aligned_timestamps, with_warning=False)
else:
assert isinstance(
aligned_timestamps, list
Expand All @@ -135,7 +135,9 @@ def set_aligned_timestamps(self, aligned_timestamps: np.ndarray):

for segment_index in range(self._number_of_segments):
self.sorting_extractor._recording.set_times(
times=aligned_timestamps[segment_index], segment_index=segment_index
times=aligned_timestamps[segment_index],
segment_index=segment_index,
with_warning=False,
)

def set_aligned_segment_timestamps(self, aligned_segment_timestamps: list[np.ndarray]):
Expand Down Expand Up @@ -164,7 +166,9 @@ def set_aligned_segment_timestamps(self, aligned_segment_timestamps: list[np.nda

for segment_index in range(self._number_of_segments):
self.sorting_extractor._recording.set_times(
times=aligned_segment_timestamps[segment_index], segment_index=segment_index
times=aligned_segment_timestamps[segment_index],
segment_index=segment_index,
with_warning=False,
)

def set_aligned_starting_time(self, aligned_starting_time: float):
Expand Down

0 comments on commit 81a022d

Please sign in to comment.