@@ -495,16 +495,17 @@ def find_parents_of_type(list_of_parents, parent_type):
495495 return parents
496496
497497
498- def check_graph (nodes ):
498+ def check_graph (nodes , check_for_peak_source = True ):
499499 """
500500 Check that node list is orderd in a good (parents are before children)
501501 """
502502
503- node0 = nodes [0 ]
504- if not isinstance (node0 , PeakSource ):
505- raise ValueError (
506- "Peak pipeline graph must have as first element a PeakSource (PeakDetector or PeakRetriever or SpikeRetriever"
507- )
503+ if check_for_peak_source :
504+ node0 = nodes [0 ]
505+ if not isinstance (node0 , PeakSource ):
506+ raise ValueError (
507+ "Peak pipeline graph must have as first element a PeakSource (PeakDetector or PeakRetriever or SpikeRetriever"
508+ )
508509
509510 for i , node in enumerate (nodes ):
510511 assert isinstance (node , PipelineNode ), f"Node { node } is not an instance of PipelineNode"
@@ -532,6 +533,7 @@ def run_node_pipeline(
532533 verbose = False ,
533534 skip_after_n_peaks = None ,
534535 recording_slices = None ,
536+ check_for_peak_source = True ,
535537):
536538 """
537539 Machinery to compute in parallel operations on peaks and traces.
@@ -587,6 +589,8 @@ def run_node_pipeline(
587589 Optionaly give a list of slices to run the pipeline only on some chunks of the recording.
588590 It must be a list of (segment_index, frame_start, frame_stop).
589591 If None (default), the function iterates over the entire duration of the recording.
592+ check_for_peak_source : bool, default True
593+ Whether to check that the first node is a PeakSource (PeakDetector or PeakRetriever or
590594
591595 Returns
592596 -------
@@ -595,7 +599,7 @@ def run_node_pipeline(
595599 If squeeze_output=True and only one output then directly np.array.
596600 """
597601
598- check_graph (nodes )
602+ check_graph (nodes , check_for_peak_source = check_for_peak_source )
599603
600604 job_kwargs = fix_job_kwargs (job_kwargs )
601605 assert all (isinstance (node , PipelineNode ) for node in nodes )
0 commit comments