99from spikeinterface .core .generate import (
1010 generate_recording ,
1111 generate_sorting ,
12- NoiseGeneratorRecording ,
12+ MockRecording ,
1313 SortingGenerator ,
1414 TransformSorting ,
1515 generate_recording_by_size ,
2222 generate_sorting_to_inject ,
2323 synthesize_random_firings ,
2424)
25+ from spikeinterface .generation import NoiseGeneratorRecording
2526
2627from spikeinterface .core .numpyextractors import NumpySorting
2728
@@ -178,7 +179,7 @@ def test_noise_generator_memory():
178179
179180 # case 1 preallocation of noise use one noise block 88M for 60000 sample of 384
180181 before_instanciation_MiB = measure_memory_allocation () / bytes_to_MiB_factor
181- rec1 = NoiseGeneratorRecording (
182+ rec1 = MockRecording (
182183 num_channels = num_channels ,
183184 sampling_frequency = sampling_frequency ,
184185 durations = durations ,
@@ -193,11 +194,11 @@ def test_noise_generator_memory():
193194 ratio = expected_allocation_MiB / expected_allocation_MiB
194195 assert (
195196 ratio <= 1.0 + relative_tolerance
196- ), f"NoiseGeneratorRecording with 'tile_pregenerated' wrong memory { memory_usage_MiB } instead of { expected_allocation_MiB } "
197+ ), f"MockRecording with 'tile_pregenerated' wrong memory { memory_usage_MiB } instead of { expected_allocation_MiB } "
197198
198199 # case 2: no preallocation very few memory (under 2 MiB)
199200 before_instanciation_MiB = measure_memory_allocation () / bytes_to_MiB_factor
200- rec2 = NoiseGeneratorRecording (
201+ rec2 = MockRecording (
201202 num_channels = num_channels ,
202203 sampling_frequency = sampling_frequency ,
203204 durations = durations ,
@@ -208,7 +209,7 @@ def test_noise_generator_memory():
208209 )
209210 after_instanciation_MiB = measure_memory_allocation () / bytes_to_MiB_factor
210211 memory_usage_MiB = after_instanciation_MiB - before_instanciation_MiB
211- assert memory_usage_MiB < 2 , f"NoiseGeneratorRecording with 'on_the_fly wrong memory { memory_usage_MiB } MiB"
212+ assert memory_usage_MiB < 2 , f"MockRecording with 'on_the_fly wrong memory { memory_usage_MiB } MiB"
212213
213214
214215def test_noise_generator_several_noise_levels ():
@@ -262,7 +263,7 @@ def test_noise_generator_correct_shape(strategy):
262263 num_channels = 2
263264 seed = 0
264265
265- lazy_recording = NoiseGeneratorRecording (
266+ lazy_recording = MockRecording (
266267 num_channels = num_channels ,
267268 sampling_frequency = sampling_frequency ,
268269 durations = durations ,
@@ -298,7 +299,7 @@ def test_noise_generator_consistency_across_calls(strategy, start_frame, end_fra
298299 num_channels = 2
299300 seed = 0
300301
301- lazy_recording = NoiseGeneratorRecording (
302+ lazy_recording = MockRecording (
302303 num_channels = num_channels ,
303304 sampling_frequency = sampling_frequency ,
304305 durations = durations ,
@@ -333,7 +334,7 @@ def test_noise_generator_consistency_across_traces(strategy, start_frame, end_fr
333334 num_channels = 2
334335 seed = start_frame + end_frame + extra_samples # To make sure that the seed is different for each test
335336
336- lazy_recording = NoiseGeneratorRecording (
337+ lazy_recording = MockRecording (
337338 num_channels = num_channels ,
338339 sampling_frequency = sampling_frequency ,
339340 durations = durations ,
@@ -353,7 +354,7 @@ def test_noise_generator_consistency_across_traces(strategy, start_frame, end_fr
353354@pytest .mark .parametrize ("seed" , [None , 42 ])
354355def test_noise_generator_consistency_after_dump (strategy , seed ):
355356 # test same noise after dump even with seed=None
356- rec0 = NoiseGeneratorRecording (
357+ rec0 = MockRecording (
357358 num_channels = 2 ,
358359 sampling_frequency = 30000.0 ,
359360 durations = [2.0 ],
0 commit comments