ogs5py.fileclasses.GLIext
- class ogs5py.fileclasses.GLIext(typ='TIN', data=None, name=None, file_ext=None, task_root=None, task_id='model')[source]
Bases:
File
Class for an external definition for the ogs GEOMETRY file.
- Parameters:
typ (
str
, optional) – Type of the extermal geometry definition. EitherTIN
for a triangulated surface orPOINT_VECTOR
for a polyline. Default:"TIN"
data (
numpy.ndarray
, optional) – Data for the external geometry definition. Default:None
name (str, optional) – File name for the RFR file. If
None
, the task_id is used. Default:None
file_ext (
str
, optional) – extension of the file (with leading dot “.rfr”) Default: “.rfr”task_root (str, optional) – Path to the destiny model folder. Default: cwd+”ogs5model”
task_id (str, optional) – Name for the ogs task. Default: “model”
- Attributes:
Methods
add_copy_link
(path[, symlink])Add a link to copy a file instead of writing.
check
([verbose])Check if the external geometry definition is valid.
Remove a former given link to an external file.
Get the OGS file class name.
read_file
(path, **kwargs)Read a given GLI_EXT input file.
reset
()Delete every content.
save
(path)Save the actual GLI external file in the given path.
Write the actual OGS input file to the given folder.
- add_copy_link(path, symlink=False)
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 external geometry definition is valid.
In the sence, that the contained data is consistent.
- Parameters:
verbose (bool, optional) – Print information for the executed checks. Default: True
- Returns:
result – Validity of the given gli.
- Return type:
- del_copy_link()
Remove a former given link to an external file.
- get_file_type()
Get the OGS file class name.
- read_file(path, **kwargs)[source]
Read a given GLI_EXT input file.
- Parameters:
path (str) – path to the file
- reset()
Delete every content.
- save(path)[source]
Save the actual GLI external file in the given path.
- Parameters:
path (str) – path to where to file should be saved
- write_file()
Write the actual OGS input file to the given folder.
Its path is given by “task_root+task_id+file_ext”.
- property is_empty
State if the OGS file is empty.