workflow.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:juicer 作者: eubr-bigsea 项目源码 文件源码
def get_topological_sorted_tasks(self):

        """ Create the tasks Graph and perform topological sorting

            A topological sort is a nonunique permutation of the nodes
            such that an edge from u to v implies that u appears before
            v in the topological sort order.

            :return: Return a list of nodes in topological sort order.
        """
        # First, map the tasks IDs to their original position
        tasks_position = {}

        for count_position, task in enumerate(self.workflow['tasks']):
            tasks_position[task['id']] = count_position

        sorted_tasks_id = nx.topological_sort(self.graph, reverse=False)

        return sorted_tasks_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号