#NEWLINE# def run_test( filename , funcs , args = [ 0 ] ) : #NEWLINE# #INDENT# nargs = len ( args ) #NEWLINE# if ( ( len ( funcs ) > 1 ) and ( nargs > 1 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'nargs > 1 and len(funcs) > 1 not supported' ) #NEWLINE# #UNINDENT# data = parse_txt_data ( filename ) #NEWLINE# if ( data . shape [ 1 ] != ( len ( funcs ) + nargs ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'data has %d items / row, but len(funcs) = %d and nargs = %d' % ( data . shape [ 1 ] , len ( funcs ) , nargs ) ) ) #NEWLINE# #UNINDENT# if ( nargs > 1 ) : #NEWLINE# #INDENT# f = funcs [ 0 ] #NEWLINE# x = [ data [ args [ i ] ] for i in x ] #NEWLINE# return f ( * x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# y = [ ] #NEWLINE# i = 1 #NEWLINE# for f in funcs : #NEWLINE# #INDENT# y . append ( ( f ( data [ : , 0 ] ) - data [ : , i ] ) ) #NEWLINE# i += 1 #NEWLINE# #UNINDENT# return ( data [ : , 0 ] , y )