Module containing advanced IO functions for relax.
This includes IO redirection, automatic loading and writing of
compressed files (both Gzip and BZ2 compression), reading and writing of
files, processing of the contents of files, etc.
|
delete(file_name,
dir=None,
fail=True)
Deleting the given file, taking into account missing compression
extensions. |
source code
|
|
(int, str)
|
|
list of lists of str
|
extract_data(file=None,
dir=None,
file_data=None,
sep=None)
Return all data in the file as a list of lines where each line is a
list of line elements. |
source code
|
|
str
|
|
str
|
|
|
|
|
io_streams_log(file_name=None,
dir=None,
verbosity=1)
Turn on logging, sending both STDOUT and STDERR streams to a file. |
source code
|
|
|
io_streams_tee(file_name=None,
dir=None,
compress_type=0,
verbosity=1)
Turn on teeing to split both STDOUT and STDERR streams and sending
second part to a file. |
source code
|
|
|
mkdir_nofail(dir=None,
verbosity=1)
Create the given directory, or exit without raising an error if the
directory exists. |
source code
|
|
file object
|
|
writable file object (if return_path, then a tuple of the writable
file and the full file path)
|
open_write_file(file_name=None,
dir=None,
force=False,
compress_type=0,
verbosity=1,
return_path=False)
Function for opening a file for writing and creating directories if
necessary. |
source code
|
|
str, list of [str, float], or list of [str, float, float]
|
read_spin_data(file=None,
dir=None,
file_data=None,
spin_id_col=None,
mol_name_col=None,
res_num_col=None,
res_name_col=None,
spin_num_col=None,
spin_name_col=None,
data_col=None,
error_col=None,
sep=None,
spin_id=None)
Generator function for reading the spin specific data from file. |
source code
|
|
list of lists of str
|
strip(data,
comments=True)
Remove all comment and empty lines from the file data structure. |
source code
|
|
|
test_binary(binary)
Function for testing that the binary string corresponds to a valid
executable file. |
source code
|
|
|
write_spin_data(file,
dir=None,
sep=None,
spin_ids=None,
mol_names=None,
res_nums=None,
res_names=None,
spin_nums=None,
spin_names=None,
force=False,
data=None,
data_name=None,
data_length=20,
data_format=None,
error=None,
error_name=None,
error_length=20,
error_format=None)
Generator function for reading the spin specific data from file. |
source code
|
|