meeg_utils.testing.check_step#

meeg_utils.testing.check_step(step, inst)[source]#

Check that a step honours the meeg-utils step contract.

The checks are:

  1. Parameters survive get_params / set_params, clone() and a round trip through the pipeline configuration format.

  2. transform before fit raises NotFittedError.

  3. fit returns the step itself and sets system_ and qc_.

  4. With copy=True, neither fit nor transform modify the input.

  5. The output has the declared type.

  6. Unless the step declares changes_channels, channel names and order are unchanged.

  7. Unless the step declares changes_times, the sampling rate, number of samples, first_samp, meas_date and annotations are unchanged (steps declaring adds_annotations may only add BAD_ ones).

  8. Every kind in plot_kinds that is available for this fit draws a figure (or a list of figures), and plot() without data draws exactly the available kinds that need none.

Parameters:
  • step (Step) – An unfitted step.

  • inst (Raw | Epochs | Evoked) – Preloaded data the step can process.

Raises:

AssertionError – If a check fails.