@@ -87,10 +87,16 @@ def get_trace_margin(self):
8787 def get_dtype (self ):
8888 return base_peak_dtype
8989
90- def get_peak_slice (self , segment_index , start_frame , end_frame , ):
90+ def get_peak_slice (
91+ self ,
92+ segment_index ,
93+ start_frame ,
94+ end_frame ,
95+ ):
9196 # not needed for PeakDetector
9297 raise NotImplementedError
9398
99+
94100# this is used in sorting components
95101class PeakDetector (PeakSource ):
96102 pass
@@ -474,7 +480,7 @@ def run_node_pipeline(
474480 nodes ,
475481 job_kwargs ,
476482 job_name = "pipeline" ,
477- #mp_context=None,
483+ # mp_context=None,
478484 gather_mode = "memory" ,
479485 gather_kwargs = {},
480486 squeeze_output = True ,
@@ -506,7 +512,7 @@ def run_node_pipeline(
506512 The gather consists of concatenating features related to peaks (localization, pca, scaling, ...) into a single big vector.
507513 These vectors can be in "memory" or in files ("npy")
508514
509-
515+
510516 Parameters
511517 ----------
512518
@@ -533,7 +539,7 @@ def run_node_pipeline(
533539 skip_after_n_peaks : None | int
534540 Skip the computation after n_peaks.
535541 This is not an exact because internally this skip is done per worker in average.
536-
542+
537543 Returns
538544 -------
539545 outputs: tuple of np.array | np.array
@@ -596,7 +602,7 @@ def _compute_peak_pipeline_chunk(segment_index, start_frame, end_frame, worker_c
596602
597603 recording_segment = recording ._recording_segments [segment_index ]
598604 node0 = nodes [0 ]
599-
605+
600606 if isinstance (node0 , (SpikeRetriever , PeakRetriever )):
601607 # in this case PeakSource could have no peaks and so no need to load traces just skip
602608 peak_slice = i0 , i1 = node0 .get_peak_slice (segment_index , start_frame , end_frame , max_margin )
@@ -676,7 +682,6 @@ def _compute_peak_pipeline_chunk(segment_index, start_frame, end_frame, worker_c
676682 return
677683
678684
679-
680685class GatherToMemory :
681686 """
682687 Gather output of nodes into list and then demultiplex and np.concatenate
0 commit comments