def show(uid): dg = get_graph(uid) result = {} tasks = [] result["uid"] = dg.graph["uid"] result["name"] = dg.graph["name"] for n in nx.topological_sort(dg): data = dg.node[n] tasks.append({"uid": n, "parameters": data, "before": dg.successors(n), "after": dg.predecessors(n)}) result["tasks"] = tasks return utils.yaml_dump(result)
def show(uid): dg = get_graph(uid) result = {} tasks = [] result['uid'] = dg.graph['uid'] result['name'] = dg.graph['name'] for task in nx.topological_sort(dg): tasks.append( {'uid': task.name, 'parameters': task.to_dict(), 'before': dg.successors(task), 'after': dg.predecessors(task) }) result['tasks'] = tasks return utils.yaml_dump(result)
def show(uid): dg = get_graph(uid) result = {} tasks = [] result['uid'] = dg.graph['uid'] result['name'] = dg.graph['name'] for n in nx.topological_sort(dg): data = dg.node[n] tasks.append({ 'uid': n, 'parameters': data, 'before': dg.successors(n), 'after': dg.predecessors(n) }) result['tasks'] = tasks return utils.yaml_dump(result)
def show(uid): dg = get_graph(uid) result = {} tasks = [] result['uid'] = dg.graph['uid'] result['name'] = dg.graph['name'] for n in nx.topological_sort(dg): data = dg.node[n] tasks.append( {'uid': n, 'parameters': data, 'before': dg.successors(n), 'after': dg.predecessors(n) }) result['tasks'] = tasks return utils.yaml_dump(result)
def to_yaml(self): return utils.yaml_dump(self.to_dict())