#NEWLINE# def read_ints( self , shape , order = 'C' , full_record = False ) : #NEWLINE# #INDENT# "\n        Returns integers as a :mod:`numpy` array of `shape`.\n\n        shape: tuple(int)\n            Dimensions of returned array.\n\n        order: string\n            If 'C', the data is in row-major order.\n            If 'Fortran', the data is in column-major order.\n\n        full_record: bool\n            If True, then read surrounding recordmarks.\n            Only meaningful if `unformatted`.\n        " #NEWLINE# reshape = False #NEWLINE# count = 1 #NEWLINE# try : #NEWLINE# #INDENT# for size in shape : #NEWLINE# #INDENT# count *= size #NEWLINE# #UNINDENT# reshape = True #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# count = shape #NEWLINE# #UNINDENT# if ( full_record and self . unformatted ) : #NEWLINE# #INDENT# reclen = self . read_recordmark ( ) #NEWLINE# if ( reclen != self . reclen_ints ( count ) ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'unexpected recordlength %d' % reclen ) ) #NEWLINE# #UNINDENT# #UNINDENT# sep = ( '' if self . binary else ' ' ) #NEWLINE# dtype = ( numpy . int64 if self . integer_8 else numpy . int32 ) #NEWLINE# data = numpy . fromfile ( self . file , dtype = dtype , count = size , sep = sep ) #NEWLINE# if self . need_byteswap : #NEWLINE# #INDENT# data . byteswap ( True ) #NEWLINE# #UNINDENT# if ( full_record and self . unformatted ) : #NEWLINE# #INDENT# reclen2 = self . read_recordmark ( ) #NEWLINE# if ( reclen2 != reclen ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'mismatched recordlength %d vs. %d' % ( reclen2 , reclen ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( data . reshape ( shape , order = order ) if reshape else data )