fixed EOWorkflow.get_tasks method in case task names are duplicated
@@ -271,11 +271,22 @@ class EOWorkflow:
workflow
:rtype: OrderedDict
"""
- tasks = collections.OrderedDict()
+ task_dict = collections.OrderedDict()
for dep in self.ordered_dependencies:
- tasks[dep.name] = dep.task
+ task_name = dep.name
- return tasks
+ if task_name in task_dict:
+ new_task_name = task_name
+ count = 0
+ while new_task_name in task_dict:
+ count += 1
+ new_task_name = '{}({})'.format(task_name, count)
+
+ task_name = new_task_name
+
+ task_dict[task_name] = dep.task
+
+ return task_dict
def get_dot(self):
""" Generates the DOT description of the underlying computational graph
