Skip to content

Commit

Permalink
better handling of task_root
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Aug 9, 2019
1 parent 68885d9 commit 8310a1d
Show file tree
Hide file tree
Showing 6 changed files with 334 additions and 347 deletions.
18 changes: 5 additions & 13 deletions ogs5py/fileclasses/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ class File(object):
Default: ".std"
"""

def __init__(
self,
task_root=os.path.join(CWD, "ogs5model"),
task_id="model",
file_ext=".std",
):
def __init__(self, task_root=None, task_id="model", file_ext=".std"):
if task_root is None:
task_root = os.path.join(CWD, "ogs5model")
self.task_root = task_root
self.task_id = task_id
self.top_com = TOP_COM
Expand Down Expand Up @@ -248,7 +245,7 @@ def __init__(
lines=None,
file_name="textfile",
file_ext=".txt",
task_root=os.path.join(CWD, "ogs5model"),
task_root=None,
task_id="model",
):
super(LineFile, self).__init__(task_root, task_id, file_ext)
Expand Down Expand Up @@ -381,12 +378,7 @@ class BlockFile(File):
STD = {}
""":class:`dict`: Standard Block OGS-BlockFile"""

def __init__(
self,
task_root=os.path.join(CWD, "ogs5model"),
task_id="model",
file_ext=".std",
):
def __init__(self, task_root=None, task_id="model", file_ext=".std"):
super(BlockFile, self).__init__(task_root, task_id, file_ext)

# list of main keywords indicated by "#"
Expand Down
6 changes: 3 additions & 3 deletions ogs5py/fileclasses/gem/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ def __init__(
dch=None,
ipm=None,
dbr=None,
task_root=os.path.join(CWD, "ogs5model"),
task_root=None,
task_id="model",
):
"""
"""
if task_root is None:
task_root = os.path.join(CWD, "ogs5model")
self._task_root = task_root
self.task_id = task_id
self.lst_name = lst_name
Expand Down
2 changes: 1 addition & 1 deletion ogs5py/fileclasses/gli/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ def __init__(
data=None,
file_name=None,
file_ext=None,
task_root=os.path.join(CWD, "ogs5model"),
task_root=None,
task_id="model",
):
super(GLIext, self).__init__(task_root, task_id)
Expand Down

0 comments on commit 8310a1d

Please sign in to comment.