Commit 20909661 authored by aknecht2's avatar aknecht2
Browse files

Added a helper function to find all final_results from workflow_module.

parent f6003efe
......@@ -271,7 +271,7 @@ class WorkflowModule(object):
msg += "Error loading '%s' jobs. File with name: '%s', value: '%s' does not exist in master_files.\n" % (self.name, param_name, arg_params[param_name])
else:
valid = False
msg += "Error loading '%s' jobs. Supplied param '%s' for argument type '%s' not defined.\n" % (self.name, param_name, arg_type)
msg += "Error loading '%s' jobs. Required param '%s' for argument type '%s' not defined.\n" % (self.name, param_name, arg_type)
return (valid, msg)
def _load_required_params(self, master_files, markers):
......@@ -369,6 +369,23 @@ class WorkflowModule(object):
outputs = job_dict[job_name]["outputs"]
return [output.keys()[0] for output in outputs]
def get_all_final_results(self, markers):
job_list = self.get_job_list(markers)
final_results = []
for i, job_dict in enumerate(job_list):
job_name = job_dict.keys()[0]
job_info = job_dict[job_name]
for file_dict in job_info["outputs"]:
file_name = file_dict.keys()[0]
file_info = file_dict[file_name]
if file_info.get("final_result"):
final_results.append({
"job_names": [job.keys()[0] for job in job_list[:i + 1]],
"file_info": file_info,
"file_name": file_name
})
return final_results
def _setup_job_params(self, master_files, job_info, markers, param_type, arg_params, outputs):
"""
:param master_files: Master file dictionary mapping file_names -> file objects.
......
Supports Markdown
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