Skip to content

Commit 2cc9348

Browse files
committed
fixing read_dot due to WfFormat 1.5 (#38)
1 parent 022fcec commit 2cc9348

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

wfcommons/common/workflow.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,11 @@ def write_json(self, json_file_path: Optional[pathlib.Path] = None) -> None:
172172
specification_tasks.append(task_spec)
173173

174174
# add machines to the workflow json object
175-
for machine in task.machines:
176-
if machine.name not in machines_list:
177-
machines_list.append(machine.name)
178-
workflow_machines.append(machine.as_dict())
175+
if task.machines:
176+
for machine in task.machines:
177+
if machine.name not in machines_list:
178+
machines_list.append(machine.name)
179+
workflow_machines.append(machine.as_dict())
179180

180181
# add files to the workflow json object (input and output)
181182
for file in task.input_files:
@@ -228,7 +229,7 @@ def read_dot(self, dot_file_path: Optional[pathlib.Path] = None) -> None:
228229
tasks_map = {}
229230
for node in graph.nodes(data=True):
230231
task_id = f"{node[1]['label']}_ID{node[0]}"
231-
task = Task(name=task_id, id=task_id, runtime=0, task_id=node[0])
232+
task = Task(name=node[1]['label'], task_id=task_id, runtime=0)
232233
self.add_task(task)
233234
tasks_map[node[0]] = task_id
234235

0 commit comments

Comments
 (0)