@@ -156,6 +156,38 @@ def test_non_trivial_wiring(self):
156156 probe = recording .get_probe ()
157157 np .testing .assert_array_equal (recording .channel_ids , probe .contact_annotations ["settings_channel_key" ])
158158
159+ def test_timestamp_loading_multi_level (self ):
160+ """
161+ Test that we can load the sync timestamps from different levels of the folder structure and
162+ that they are the same.
163+ """
164+ recording_folder = (
165+ local_folder / "openephysbinary/v0.6.x_neuropixels_with_sync/Record Node 104/experiment1/recording1"
166+ )
167+ stream_name = "Record Node 104#Neuropix-PXI-100.ProbeA-AP"
168+ block_index = 0
169+
170+ recording_from_recording_folder = self .ExtractorClass (
171+ recording_folder ,
172+ stream_name = stream_name ,
173+ block_index = block_index ,
174+ load_sync_timestamps = True ,
175+ )
176+ assert recording_from_recording_folder .has_time_vector ()
177+ timestamps_recording = recording_from_recording_folder .get_times ()
178+ parent_folder = recording_folder
179+ for _ in range (3 ):
180+ parent_folder = parent_folder .parent
181+ recording_from_parent = self .ExtractorClass (
182+ parent_folder ,
183+ stream_name = stream_name ,
184+ block_index = block_index ,
185+ load_sync_timestamps = True ,
186+ )
187+ assert recording_from_parent .has_time_vector ()
188+ timestamps_parent = recording_from_parent .get_times ()
189+ np .testing .assert_array_equal (timestamps_recording , timestamps_parent )
190+
159191
160192class OpenEphysBinaryEventTest (EventCommonTestSuite , unittest .TestCase ):
161193 ExtractorClass = OpenEphysBinaryEventExtractor
0 commit comments