carputils
Doxygen code documentation for the python framework controlling openCARP
Public Member Functions | Static Public Attributes | List of all members
carputils.carpio.bin.BinFile Class Reference

Bench .bin format file IO class. More...

Inheritance diagram for carputils.carpio.bin.BinFile:
carputils.carpio.filelike.FileLikeMixin

Public Member Functions

def __init__ (self, filename, mode='r')
 
def close (self)
 Close the file object. More...
 
def data (self)
 
def write (self, data)
 Write a numpy array to an IGB file. More...
 
- Public Member Functions inherited from carputils.carpio.filelike.FileLikeMixin
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_val, exc_tb)
 

Static Public Attributes

 DTYPE = np.dtype('<d')
 

Detailed Description

Bench .bin format file IO class.

This class is little more than an elaborate wrapper for the numpy fromfile and tofile functions, but is included for completeness in the carputils.carpio module.

Constructor & Destructor Documentation

◆ __init__()

def carputils.carpio.bin.BinFile.__init__ (   self,
  filename,
  mode = 'r' 
)
Parameters
filenamethe filename to open
mode'r' for read mode (default), 'w' for write mode

Member Function Documentation

◆ close()

def carputils.carpio.bin.BinFile.close (   self)

Close the file object.

◆ data()

def carputils.carpio.bin.BinFile.data (   self)
Returns
numpy data array with the file contents

◆ write()

def carputils.carpio.bin.BinFile.write (   self,
  data 
)

Write a numpy array to an IGB file.

Parameters
dataThe array to be written to the IGB file

Member Data Documentation

◆ DTYPE

carputils.carpio.bin.BinFile.DTYPE = np.dtype('<d')
static

The documentation for this class was generated from the following file: