ogs5py.fileclasses.base.File
- class ogs5py.fileclasses.base.File(task_root=None, task_id='model', file_ext='.std')[source]
Bases:
object
File class with minimal functionality.
- Parameters:
- Attributes:
Methods
add_copy_link
(path[, symlink])Add a link to copy a file instead of writing.
check
([verbose])Check if the given file is valid.
Remove a former given link to an external file.
Get the OGS file class name.
read_file
(path[, encoding, verbose])Read an existing file.
reset
()Delete every content.
save
(path, **kwargs)Save the actual file in the given path.
Write the actual OGS input file to the given folder.
- add_copy_link(path, symlink=False)[source]
Add a link to copy a file instead of writing.
Instead of writing a file, you can give a path to an existing file, that will be copied/linked to the target folder.
- Parameters:
path (str) – path to the existing file that should be copied
symlink (bool, optional) – on UNIX systems it is possible to use a symbolic link to save time if the file is big. Default: False
- check(verbose=True)[source]
Check if the given file is valid.
- Parameters:
verbose (bool, optional) – Print information for the executed checks. Default: True
- Returns:
result – Validity of the given file.
- Return type:
- save(path, **kwargs)[source]
Save the actual file in the given path.
- Parameters:
path (str) – path to where to file should be saved