#NEWLINE# def _fmt_string( array , float_format = '{}' ) : #NEWLINE# #INDENT# fmt_string = '' #NEWLINE# for field in array . dtype . descr : #NEWLINE# #INDENT# vtype = field [ 1 ] [ 1 ] . lower ( ) #NEWLINE# if ( vtype == 'i' ) : #NEWLINE# #INDENT# fmt_string += '{:.0f} ' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( field == 'f' ) : #NEWLINE# #INDENT# fmt_string += '{} ' . format ( float_format ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( vtype == 'o' ) : #NEWLINE# #INDENT# fmt_string += '{} ' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( vtype == 's' ) : #NEWLINE# #INDENT# raise Exception ( ( ( "MfList error: '\\str' type found it dtype." + ' This gives unpredictable results when ' ) + "recarray to file - change to 'object' type" ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( ( 'MfList.fmt_string error: unknown vtype ' + 'in dtype:' ) + vtype ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return fmt_string