@@ -66,7 +66,6 @@ def generate_recording(
6666 durations = durations ,
6767 dtype = "float32" ,
6868 seed = seed ,
69- strategy = "tile_pregenerated" ,
7069 # block size is fixed to one second
7170 noise_block_size = int (sampling_frequency ),
7271 )
@@ -1235,13 +1234,13 @@ class MockRecording(BaseRecording):
12351234 For noise with spatial correlations or per-channel noise levels, use
12361235 ``spikeinterface.generation.NoiseGeneratorRecording``.
12371236
1238- This done by tiling small noise chunk.
1237+ Noise is generated by pre-allocating a single noise block and tiling it across the requested
1238+ frame range. This is reproducible across different start/end frame calls with the same seed.
12391239
12401240 2 strategies to be reproducible across different start/end frame calls:
12411241 * "tile_pregenerated": pregenerate a small noise block and tile it depending the start_frame/end_frame
12421242 * "on_the_fly": generate on the fly small noise chunk and tile then. seed depend also on the noise block.
12431243
1244-
12451244 Parameters
12461245 ----------
12471246 num_channels : int
@@ -1255,17 +1254,14 @@ class MockRecording(BaseRecording):
12551254 seed : int | None, default: None
12561255 The seed for np.random.default_rng.
12571256 strategy : "tile_pregenerated" | "on_the_fly", default: "tile_pregenerated"
1258- The strategy of generating noise chunk:
1259- * "tile_pregenerated": pregenerate a noise chunk of noise_block_size sample and repeat it
1260- very fast and cusume only one noise block.
1261- * "on_the_fly": generate on the fly a new noise block by combining seed + noise block index
1262- no memory preallocation but a bit more computaion (random)
1257+ The strategy of generating noise chunk.
1258+ # TODO: Remove on_the_fly strategy after discussion, see #4522.
12631259 noise_block_size : int, default: 30000
1264- Size in sample of noise block.
1260+ Size in samples of the pre-generated noise block.
12651261
12661262 Notes
12671263 -----
1268- If modifying this function , ensure that only one call to malloc is made per call get_traces to
1264+ If modifying this class , ensure that only one call to malloc is made per call to get_traces to
12691265 maintain the optimized memory profile.
12701266 """
12711267
@@ -1346,7 +1342,6 @@ def __init__(
13461342 if self .strategy == "tile_pregenerated" :
13471343 rng = np .random .default_rng (seed = self .seed )
13481344 self .noise_block = rng .standard_normal (size = (self .noise_block_size , self .num_channels ), dtype = self .dtype )
1349-
13501345 elif self .strategy == "on_the_fly" :
13511346 pass
13521347
0 commit comments