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:
object
General class for writing output files. It should be used as wrapper for customized
Writer
.- Attributes:
datadir
Data directory of output files.
description
Description of
Writer
.dumping
If
True
dump 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
True
existing output files will be overwritten.read
Reader
object for reading output files.verbosity
Verbosity of the writer.
zfill
Zero 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
Frame
to dump fileAttributes Summary
Data directory of output files.
Description of
Writer
.If
True
dump files will be written.Filename extension of output files.
Base filename of output files.
Dictionary of keyword arguments passed to customized writing routine.
If
True
existing output files will be overwritten.Reader
object 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
Frame
to dump fileAttributes Documentation
- datadir
Data directory of output files.
- description
Description of
Writer
.
- dumping
If
True
dump 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
True
existing output files will be overwritten.
- read
Reader
object 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='')[source]
Writes output to file
- Parameters:
owner (Frame) – Parent
Frame
objecti (int) – Number of output
forceoverwrite (boolean) – If
True
it 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