#NEWLINE# def process_file( kind , prec , clevel , synth ) : #NEWLINE# #INDENT# if ( kind == 'numpy' ) : #NEWLINE# #INDENT# lib = 'none' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lib = kind #NEWLINE# #UNINDENT# if r : #NEWLINE# #INDENT# prefix = 'synth/synth-' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# prefix = 'cellzome/cellzome-' #NEWLINE# #UNINDENT# iname = ( '%s/%s-%s%d-%s.h5' % ( dirname , prefix , kind , clevel , prec ) ) #NEWLINE# f = tb . open_file ( iname , 'r' ) #NEWLINE# a_ = f . root . maxarea #NEWLINE# b_ = f . root . mascotscore #NEWLINE# oname = ( '%s/%s-%s%d-%s-r.h5' % ( dirname , prefix , kind , clevel , prec ) ) #NEWLINE# f2 = tb . open_file ( oname , 'w' ) #NEWLINE# if ( lib == 'none' ) : #NEWLINE# #INDENT# filters = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# filters = tb . Filters ( complib = lib , complevel = clevel , shuffle = shuffle ) #NEWLINE# #UNINDENT# if ( prec == 'single' ) : #NEWLINE# #INDENT# type_ = tb . Float32Atom ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# type_ = tb . Float64Atom ( ) #NEWLINE# #UNINDENT# r = f2 . create_carray ( '/' , 'r' , type_ , a_ . shape , filters = filters ) #NEWLINE# if ( kind == 'numpy' ) : #NEWLINE# #INDENT# ( a2 , b2 ) = ( a_ [ : ] , b_ [ : ] ) #NEWLINE# t0 = time ( ) #NEWLINE# r = eval ( expression , { #NEWLINE# #INDENT# 'a' : a2 , #NEWLINE# 'b' : b2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# print ( ( '%5.2f' % round ( ( time ( ) - t0 ) , 3 ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# expr = tb . Expr ( expression , { #NEWLINE# #INDENT# 'a' : a_ , #NEWLINE# 'b' : b_ , #NEWLINE# #UNINDENT# } ) #NEWLINE# expr . set_output ( r ) #NEWLINE# expr . eval ( ) #NEWLINE# #UNINDENT# f . close ( ) #NEWLINE# f2 . close ( ) #NEWLINE# size = ( float ( os . stat ( iname ) [ 6 ] ) + float ( os . stat ( oname ) [ 6 ] ) ) #NEWLINE# return size