NiBabel

Access a cacophony of neuro-imaging file formats

This Page

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,height=0.75]; }

class nibabel.batteryrunners.BatteryRunner(checks)

Class to run set of checks

Methods

check_fix
check_only

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,))

Methods

check_fix
check_only
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