mpacts.io. csv_writer

In order to be able to use this module import it like this:

import mpacts.io.csv_writer
#or assign it to a shorter name
import mpacts.io.csv_writer as csv

CSVWriter

class mpacts.io.csv_writer.CSVWriter

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Writer for CSV files for an arraymanager. The writer acts on the data member given in the constructor, which has to be an arraymanager. By default all arrays are written out, except those who have a disable_CSV_write child.
Default location: ‘loop_cmds/output_cmds’
  • Required keywords:
    • data — The manager of which the data will be written (CSV writer is not recursive!)
    • filename — The base filename of the files that will be written. A number will be appended to differentiate between different timesteps.
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • write_header (default value = 1) — Decides if a header is added or not.
    • write_index (default value = 0) — The current sequential number of the output file.
    • write_time (default value = 0) — Decides if a comment is added on the first line with the current time on it. (Paraview does not like this!).
object __init__(tuple args, dict kwds) :
args: name, parent kwds: data, filename, [gate, write_header, write_time, write_index]
CSVWriter(name, parent, **kwargs)
file_name((CSVWriter)self) → str :

Return the filename of the file that is currently open for writing,or an empty string if no file is open.