Commit 51ad7a62 authored by Alexander.Zech's avatar Alexander.Zech

bugfix: remove typos

parent 06b8d0f8
......@@ -173,8 +173,8 @@ class Input(object):
return cls(path_src, inp_string=content, to_file=False)
def save_input(self):
if not os.path.exists(inp_obj.wdir):
os.makedirs(inp_obj.wdir)
if not os.path.exists(self.wdir):
os.makedirs(self.wdir)
with open(self.filepath, "w") as f:
f.write(self.input_string)
......@@ -356,7 +356,7 @@ class Job(object):
"""
# do we have an output file?
out_exists = os.path.exists(path_to_out)
out_exists = os.path.exists(path_to_outfile)
if not out_exists:
# status then stays the default, i.e. 'None'
return False
......@@ -389,7 +389,8 @@ class Job(object):
def is_successful(self, out_extension='out',
success_string="Have a nice day.",
success_fct=None,
ignore_meta=False):
ignore_meta=False,
use_CCParser=True):
""" Checks whether job finished with good output.
In principle there are three cases to be considered:
......@@ -413,6 +414,8 @@ class Job(object):
ignore_meta : bool
Ignore existing meta file (default: False). Effectively overwrites
old meta with new one.
use_CCParser : bool
Use CCParser module if possible (defautl: True).
"""
# output info
outfile = ".".join([self.meta["basename"], out_extension])
......@@ -431,7 +434,8 @@ class Job(object):
# Case (3) - parse output
successful = self.good_output(path_to_out,
success_string=success_string,
success_fct=success_fct)
success_fct=success_fct,
use_CCParser=use_CCParser)
# update meta file
self.save_meta()
return not is_running and successful
......@@ -473,7 +477,8 @@ class Job(object):
out_extension='out',
success_string="Have a nice day.",
success_fct=None,
ignore_meta=False):
ignore_meta=False,
use_CCParser=True):
""" Safe-submit job based on meta conditions.
In principle there are three cases to be considered:
......@@ -498,6 +503,8 @@ class Job(object):
ignore_meta : bool
Ignore existing meta file (default: False). Effectively overwrites
old meta with new one.
use_CCParser : bool
Use CCParser module if possible (defautl: True).
"""
# output info
# outfile = ".".join([self.meta["basename"], out_extension])
......@@ -527,7 +534,8 @@ class Job(object):
if not self.is_successful(out_extension=out_extension,
success_string=success_string,
success_fct=success_fct,
ignore_meta=ignore_meta):
ignore_meta=ignore_meta,
use_CCParser=use_CCParser):
self.submit(dry_run=dry_run, silent=silent)
self.meta["status"] = 'PENDING'
self.save_meta()
......@@ -572,7 +580,8 @@ class Job(object):
out_extension='out',
success_string="Have a nice day.",
success_fct=None,
ignore_meta=False):
ignore_meta=False,
use_CCParser=True):
""" Safe-run job interactively based on meta conditions.
Parameters
......@@ -592,12 +601,15 @@ class Job(object):
ignore_meta : bool
Ignore existing meta file (default: False). Effectively overwrites
old meta with new one.
use_CCParser : bool
Use CCParser module if possible (defautl: True).
"""
if not self.is_successful(out_extension=out_extension,
success_string=success_string,
success_fct=success_fct,
ignore_meta=ignore_meta):
ignore_meta=ignore_meta,
use_CCParser=use_CCParser):
self.run(dry_run=dry_run, silent=silent)
self.meta["status"] = 'PENDING'
self.save_meta()
......
......@@ -16,11 +16,11 @@ class SLURM(object):
state = {"active": "RUNNING",
"finished": "COMPLETE",
"failed" : "FAILED",
"cancelled" : "CANCELLED"
"cancelled" : "CANCELLED",
"timeout" : "TIMEOUT"
}
inv_state = {v: k for k, v in SLURM.state.items()}
inv_state = {v: k for k, v in state.items()}
def __init__(self):
pass
......@@ -73,7 +73,7 @@ class PBS(object):
"jobname" : "-N $jobname"
}
queue_factory(q_string):
def queue_factory(q_string):
if q_string.lower() == "slurm":
return SLURM()
elif q_string.lower() == "pbs":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment