Skip to content

Commit

Permalink
DOC update
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Aug 9, 2019
1 parent 70f625a commit 8790ae9
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 79 deletions.
2 changes: 1 addition & 1 deletion ogs5py/fileclasses/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _get_clsname(cls):
return cls.__name__

def get_file_type(self):
"""Get the OGS file class name"""
"""Get the OGS file class name."""
return self._get_clsname()

@property
Expand Down
54 changes: 21 additions & 33 deletions ogs5py/ogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ def __init__(self, task_root=None, task_id="model", output_dir=None):

@property
def top_com(self):
"""
Get and set the top comment for the ogs files.
"""
"""Get and set the top comment for the ogs files."""
return self._top_com

@top_com.setter
Expand All @@ -216,9 +214,7 @@ def top_com(self, value):

@property
def bot_com(self):
"""
Get and set the bottom comment for the ogs files.
"""
"""Get and set the bottom comment for the ogs files."""
return self._bot_com

@bot_com.setter
Expand All @@ -230,9 +226,7 @@ def bot_com(self, value):

@property
def task_root(self):
"""
Get and set the task_root path of the ogs model.
"""
"""Get and set the task_root path of the ogs model."""
return self._task_root

@task_root.setter
Expand All @@ -255,9 +249,7 @@ def task_root(self, value):

@property
def task_id(self):
"""
:class:`str`: task_id (name) of the ogs model.
"""
""":class:`str`: task_id (name) of the ogs model."""
return self._task_id

@task_id.setter
Expand All @@ -272,9 +264,7 @@ def task_id(self, value):

@property
def output_dir(self):
"""
:class:`str`: output directory path of the ogs model.
"""
""":class:`str`: output directory path of the ogs model."""
return self._output_dir

@output_dir.setter
Expand All @@ -291,9 +281,7 @@ def output_dir(self, value):

@property
def has_output_dir(self):
"""
:class:`bool`: State if the model has a separate output directory.
"""
""":class:`bool`: State if the model has a output directory."""
return self.output_dir is not None

def add_copy_file(self, path):
Expand Down Expand Up @@ -328,6 +316,7 @@ def del_copy_file(self, index=None):
def add_mpd(self, mpd_file):
"""
Method to add an ogs MEDIUM_PROPERTIES_DISTRIBUTED file to the model.
This is used for disributed information in the MMP file.
See ogs5py.MPD for further information
Expand Down Expand Up @@ -356,6 +345,7 @@ def del_mpd(self, index=None):
def add_gli_ext(self, gli_ext_file):
"""
Method to add an external Geometry definition file to the model.
This is used for TIN definition in SURFACE or POINT_VECTOR definition
in POLYLINE in the GLI file.
Expand Down Expand Up @@ -385,6 +375,7 @@ def del_gli_ext(self, index=None):
def add_rfr(self, rfr_file):
"""
Method to add an ogs RESTART file to the model.
This is used for disributed information in the IC file.
See ogs5py.IC for further information
Expand Down Expand Up @@ -413,6 +404,7 @@ def del_rfr(self, index=None):
def add_gem_init(self, gem_init_file):
"""
Method to add a GEMS3K input file.
This is usually generated by GEM-SELEKTOR.
See ogs5py.GEM and ogs5py.GEMinit for further information
Expand Down Expand Up @@ -466,9 +458,7 @@ def del_asc(self, index=None):
print("OGS.del_rfr: given index is not valid.")

def reset(self):
"""
Delete every content.
"""
"""Delete every content."""
for ext in OGS_EXT:
# workaround to get access to class-members by name
getattr(self, ext[1:]).reset()
Expand All @@ -487,9 +477,7 @@ def reset(self):
self.bot_com = self._bot_com

def write_input(self):
"""
method to call all write_file() methods that are initialized
"""
"""Method to call all write_file() methods that are initialized."""
for ext in OGS_EXT:
# workaround to get access to class-members by name
ogs_file = getattr(self, ext[1:])
Expand Down Expand Up @@ -533,7 +521,7 @@ def gen_script(
separate_files=None,
):
"""
Generate a python script for the given model
Generate a python script for the given model.
Parameters
----------
Expand Down Expand Up @@ -825,7 +813,7 @@ def load_model(

def readvtk(self, pcs="ALL", output_dir=None):
r"""
Reader for vtk outputfiles of this OGS5 model
Reader for vtk outputfiles of this OGS5 model.
Parameters
----------
Expand Down Expand Up @@ -874,7 +862,7 @@ def readvtk(self, pcs="ALL", output_dir=None):

def readpvd(self, pcs="ALL", output_dir=None):
r"""
read the paraview pvd files of this OGS5 model
Read the paraview pvd files of this OGS5 model.
All concerned files are converted to a dictionary containing their data
Expand Down Expand Up @@ -925,7 +913,7 @@ def readpvd(self, pcs="ALL", output_dir=None):

def readtec_point(self, pcs="ALL", output_dir=None):
r"""
collect TECPLOT point output from this OGS5 model
Collect TECPLOT point output from this OGS5 model.
Parameters
----------
Expand Down Expand Up @@ -958,9 +946,9 @@ def readtec_point(self, pcs="ALL", output_dir=None):
Returns
-------
result : dict
keys are the point names and the items are the data from the
corresponding files
if pcs="ALL", the output is a dictionary with the PCS-types as keys
Keys are the point names and the items are the data from the
corresponding files. If pcs="ALL",
the output is a dictionary with the PCS-types as keys.
"""
from ogs5py.reader import readtec_point as read

Expand All @@ -974,7 +962,7 @@ def readtec_point(self, pcs="ALL", output_dir=None):

def readtec_polyline(self, pcs="ALL", trim=True, output_dir=None):
r"""
collect TECPLOT polyline output from this OGS5 model
Collect TECPLOT polyline output from this OGS5 model.
Parameters
----------
Expand Down Expand Up @@ -1067,7 +1055,7 @@ def run_model(
Returns
-------
success : bool
State if OGS5 returned, that it terminated 'normally'.
State if OGS5 terminated 'normally'.
"""
# look for the standard ogs executable in the standard-path
if ogs_root is None:
Expand Down
32 changes: 16 additions & 16 deletions ogs5py/reader/reader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
"""
Reader for the OGS5 Output.
"""
"""Reader for the OGS5 Output."""

from __future__ import absolute_import, division, print_function

Expand Down Expand Up @@ -39,9 +37,7 @@


def readvtk_single(infile):
"""
read an arbitrary vtk/vtkXML file to a dictionary containing its data
"""
"""Read an arbitrary vtk/vtkXML file to a dictionary wtih its data."""
xml_checker = vtkXMLFileReadTester()
xml_checker.SetFileName(infile)
is_xml = bool(xml_checker.TestReadFile())
Expand Down Expand Up @@ -101,7 +97,8 @@ def readvtk_single(infile):

def readvtk(task_root=".", task_id=None, pcs="ALL", single_file=None):
r"""
a genearal reader for OGS vtk outputfiles
A genearal reader for OGS vtk outputfiles.
give a dictionary containing their data
the Filename of the pvd is structured the following way:
Expand Down Expand Up @@ -228,8 +225,9 @@ def readvtk(task_root=".", task_id=None, pcs="ALL", single_file=None):

def readpvd_single(infile):
"""
read a paraview pvd file and convert all concerned files
to a dictionary containing their data
Read a paraview pvd file.
Convert all concerned files to a dictionary containing their data.
"""
output = {}
# read the pvd file as XML and extract the needed file infos
Expand Down Expand Up @@ -258,8 +256,9 @@ def readpvd_single(infile):

def readpvd(task_root=".", task_id=None, pcs="ALL", single_file=None):
r"""
read a paraview pvd file and convert all concerned files
to a dictionary containing their data
Read a paraview pvd file.
Convert all concerned files to a dictionary containing their data.
the Filename of the pvd is structured the following way:
{task_id}[_{PCS}].pvd
Expand Down Expand Up @@ -371,7 +370,7 @@ def readpvd(task_root=".", task_id=None, pcs="ALL", single_file=None):

def readtec_point(task_root=".", task_id=None, pcs="ALL", single_file=None):
r"""
collect TECPLOT point output from OGS5
Collect TECPLOT point output from OGS5.
the Filenames are structured the following way:
{task_id}_time_{NAME}[_{PCS+extra}].tec
Expand Down Expand Up @@ -454,7 +453,7 @@ def readtec_polyline(
task_root=".", task_id=None, pcs="ALL", single_file=None, trim=True
):
r"""
collect TECPLOT polyline output from OGS5
Collect TECPLOT polyline output from OGS5.
the Filenames are structured the following way:
{task_id}_ply_{NAME}_t{ply_id}[_{PCS}].tec
Expand Down Expand Up @@ -558,9 +557,10 @@ def readtec_polyline(

def readtec_domain():
"""
This is a dummy for the TECPLOT-domain output of OGS which is not
implemented because the output is separated by element types where
VTK works out much better.
A dummy for the TECPLOT-domain output of OGS.
It is not implemented, because the output is separated by element types,
where VTK works out much better.
"""
raise NotImplementedError(
"Reader for Tecplot domain "
Expand Down

0 comments on commit 8790ae9

Please sign in to comment.