def print_dot_chart(self):
        """Print a dot output graph representing the workflow."""
        print("digraph toil_graph {")
        print("# This graph was created from job-store: %s" % self.jobStoreName)

        # Make job IDs to node names map
        jobsToNodeNames = dict(enumerate(map(lambda job: job.jobStoreID, self.jobsToReport)))

        # Print the nodes
        for job in set(self.jobsToReport):
            print('%s [label="%s %s"];' % (
                jobsToNodeNames[job.jobStoreID], job.jobName, job.jobStoreID))

        # Print the edges
        for job in set(self.jobsToReport):
            for level, jobList  in enumerate(job.stack):
                for childJob in jobList:
                    # Check, b/c successor may be finished / not in the set of jobs
                    if childJob.jobStoreID in jobsToNodeNames:
                        print('%s -> %s [label="%i"];' % (
                            jobsToNodeNames[job.jobStoreID],
                            jobsToNodeNames[childJob.jobStoreID], level))
        print("}")
def print_dot_chart ( self ) : print ( "digraph toil_graph {" ) print ( "# This graph was created from job-store: %s" % self . jobStoreName ) jobsToNodeNames = dict ( enumerate ( map ( lambda job : job . jobStoreID , self . jobsToReport ) ) ) for job in set ( self . jobsToReport ) : print ( '%s [label="%s %s"];' % ( jobsToNodeNames [ job . jobStoreID ] , job . jobName , job . jobStoreID ) ) for job in set ( self . jobsToReport ) : for level , jobList in enumerate ( job . stack ) : for childJob in jobList : if childJob . jobStoreID in jobsToNodeNames : print ( '%s -> %s [label="%i"];' % ( jobsToNodeNames [ job . jobStoreID ] , jobsToNodeNames [ childJob . jobStoreID ] , level ) ) print ( "}" )
Print a dot output graph representing the workflow.