NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.batteryrunners.Report

Next topic

nibabel.batteryrunners.Report

Reggie -- the one

nibabel.batteryrunners.BatteryRunner

digraph inheritanceda05334464 { rankdir=LR; ratio=compress; fontsize=14; size="6.0, 8.0"; "BatteryRunner" [shape=ellipse,URL="#nibabel.batteryrunners.BatteryRunner",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=14,color=dodgerblue1,style=filled,tooltip="Class to run set of checks",height=0.75]; }

class nibabel.batteryrunners.BatteryRunner(checks)

Class to run set of checks

Initialize instance from sequence of checks

Parameters:

checks : sequence

sequence of checks, where checks are callables matching signature obj, rep = chk(obj, fix=False). Checks are run in the order they are passed.

Examples

>>> def chk(obj, fix=False): # minimal check
...     return obj, Report()
>>> btrun = BatteryRunner((chk,))
check_fix(obj)

Run checks, with fixes, on obj returning obj, reports

Parameters:

obj : anything

object on which to run checks, fixes

Returns:

obj : anything

possibly modified or replaced obj, after fixes

reports : sequence

sequence of reports on checks, fixes

check_only(obj)

Run checks on obj returning reports

Parameters:

obj : anything

object on which to run checks

Returns:

reports : sequence

sequence of report objects reporting on result of running checks (withou fixes) on obj