write(self,
run=None,
file=' results ' ,
dir=' run ' ,
force=0,
format=' columnar ' ,
compress_type=1)
| source code
|
Function for writing results of the run to a file.
Keyword Arguments
~~~~~~~~~~~~~~~~~
run: The name of the run.
file: The name of the file to output results to. The default is 'results'.
dir: The directory name.
force: A flag which, if set to 1, will cause the results file to be overwritten.
format: The format of the output.
compress_type: The type of compression to use when creating the file.
Description
~~~~~~~~~~~
If no directory name is given, the results file will be placed in a directory named after
the run name. To place the results file in the current working directory, set dir to None.
The default behaviour of this function is to compress the file using bzip2 compression. If
the extension '.bz2' is not included in the file name, it will be added. The compression
can, however, be changed to either no compression or gzip compression. This is controlled
by the compress_type argument which can be set to
0: No compression (no file extension),
1: bzip2 compression ('.bz2' file extension),
2: gzip compression ('.gz' file extension).
The complementary read function will automatically handle the compressed files.
|