Writer
- class simframe.io.Writer(func, datadir='data', filename='data', zfill=4, extension='out', overwrite=False, dumping=True, reader=None, verbosity=1, description='', options={})[source]
Bases:
objectGeneral class for writing output files. It should be used as wrapper for customized
Writer.- Attributes:
datadirData directory of output files.
descriptionDescription of
Writer.dumpingIf
Truedump files will be written.extensionFilename extension of output files.
filenameBase filename of output files.
optionsDictionary of keyword arguments passed to customized writing routine.
overwriteIf
Trueexisting output files will be overwritten.readReaderobject for reading output files.verbosityVerbosity of the writer.
zfillZero padding of numbered files names.
Methods
checkdatadir([datadir, createdir])Function checks if data directory exists and creates it if necessary.
write(owner, i, forceoverwrite[, filename])Writes output to file
writedump(frame[, filename])Writes the
Frameto dump fileAttributes Summary
Data directory of output files.
Description of
Writer.If
Truedump files will be written.Filename extension of output files.
Base filename of output files.
Dictionary of keyword arguments passed to customized writing routine.
If
Trueexisting output files will be overwritten.Readerobject for reading output files.Verbosity of the writer.
Zero padding of numbered files names.
Methods Summary
checkdatadir([datadir, createdir])Function checks if data directory exists and creates it if necessary.
write(owner, i, forceoverwrite[, filename])Writes output to file
writedump(frame[, filename])Writes the
Frameto dump fileAttributes Documentation
- datadir
Data directory of output files.
- description
Description of
Writer.
- dumping
If
Truedump files will be written.
- extension
Filename extension of output files.
- filename
Base filename of output files.
- options
Dictionary of keyword arguments passed to customized writing routine.
- overwrite
If
Trueexisting output files will be overwritten.
- read
Readerobject for reading output files.
- verbosity
Verbosity of the writer.
- zfill
Zero padding of numbered files names.
Methods Documentation
- checkdatadir(datadir=None, createdir=False)[source]
Function checks if data directory exists and creates it if necessary.
- Parameters:
datadir (string or None, optinal, default : None) – Data directory to be checked. If None it assumes the data directory of the parent writer.
createdir (boolen, optional, default : False) – If True function creates data directory if it does not exist.
- Returns:
datadirexists – True if directory exists, False if not
- Return type:
boolean
- write(owner, i, forceoverwrite, filename=None)[source]
Writes output to file
- Parameters:
owner (Frame) – Parent
Frameobjecti (int) – Number of output
forceoverwrite (boolean) – If
Trueit will forces and overwrite of the file if it exists independent of the writer attributefilename (string) – If this is not “” the writer will use this filename instead of the standard scheme