當前位置: 首頁>>代碼示例>>Python>>正文


Python Pipeline.printout_graph方法代碼示例

本文整理匯總了Python中ruffus.Pipeline.printout_graph方法的典型用法代碼示例。如果您正苦於以下問題:Python Pipeline.printout_graph方法的具體用法?Python Pipeline.printout_graph怎麽用?Python Pipeline.printout_graph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ruffus.Pipeline的用法示例。


在下文中一共展示了Pipeline.printout_graph方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_newstyle_graphviz_dot

# 需要導入模塊: from ruffus import Pipeline [as 別名]
# 或者: from ruffus.Pipeline import printout_graph [as 別名]
    def test_newstyle_graphviz_dot(self):
        test_pipeline = Pipeline("test")
        test_pipeline.check_if_uptodate (Up_to_date_task1, lambda : (False, ""))
        test_pipeline.follows(Up_to_date_task2, Up_to_date_task1)\
            .check_if_uptodate (lambda : (False, ""))\
            .graphviz(URL='"http://cnn.com"', fillcolor = '"#FFCCCC"',
                            color = '"#FF0000"', pencolor='"#FF0000"', fontcolor='"#4B6000"',
                            label_suffix = "???", label_prefix = "What is this?<BR/> ",
                            label = "<What <FONT COLOR=\"red\">is</FONT>this>",
                            shape= "component", height = 1.5, peripheries = 5,
                            style="dashed")
        test_pipeline.follows(Up_to_date_task3, Up_to_date_task2)\
            .check_if_uptodate (lambda : (False, ""))
        test_pipeline.follows(Up_to_date_final_target, Up_to_date_task3)\
            .check_if_uptodate (lambda : (False, ""))
        test_pipeline.follows(Explicitly_specified_task, Up_to_date_task1)\
            .check_if_uptodate (lambda : (False, ""))
        test_pipeline.follows(Task_to_run1, Explicitly_specified_task)
        test_pipeline.follows(Task_to_run2, Task_to_run1)
        test_pipeline.follows(Task_to_run3, Task_to_run2)
        test_pipeline.follows(Up_to_date_task_forced_to_rerun, Task_to_run2)\
            .check_if_uptodate (lambda : (False, ""))
        test_pipeline.follows(Final_target, Up_to_date_task_forced_to_rerun, Task_to_run3)
        test_pipeline.follows(Downstream_task1_ignored, Final_target)
        test_pipeline.follows(Downstream_task2_ignored, Final_target)

        if sys.hexversion >= 0x03000000:
            # everything is unicode in python3
            s = BytesIO()
        else:
            s = StringIO()


        test_pipeline.printout_graph (
                                        s,
                                        # use flowchart file name extension to decide flowchart format
                                        #   e.g. svg, jpg etc.
                                        "dot",
                                        [Final_target, Up_to_date_final_target])
        self.assertTrue('[URL="http://cnn.com", color="#FF0000", fillcolor="#FFCCCC", fontcolor="#4B6000", height=1.5, label=<What is this?<BR/> What <FONT COLOR="red">is</FONT>this???>, pencolor="#FF0000", peripheries=5, shape=component, style=dashed]' in s.getvalue().decode())
開發者ID:Genomicsplc,項目名稱:ruffus,代碼行數:42,代碼來源:test_graphviz.py

示例2: test_newstyle_ruffus

# 需要導入模塊: from ruffus import Pipeline [as 別名]
# 或者: from ruffus.Pipeline import printout_graph [as 別名]
    def test_newstyle_ruffus (self):

        print("     Run pipeline normally...")
        test_pipeline = Pipeline("test")
        test_pipeline.originate(make_start, [tempdir + 'start'])

        test_pipeline.split(split_start, make_start, tempdir + '*.split')

        test_pipeline.subdivide(subdivide_start, split_start, formatter(), tempdir + '{basename[0]}_*.subdivided', tempdir + '{basename[0]}')
        if self.graph_viz_present:
            test_pipeline.printout_graph(tempdir + "flowchart.dot")
            test_pipeline.printout_graph(tempdir + "flowchart.jpg",
                                        target_tasks =[subdivide_start],
                                        forcedtorun_tasks = [split_start],
                                        no_key_legend = True)
            test_pipeline.printout_graph(tempdir + "flowchart.svg", no_key_legend = False)
            # Unknown format
            try:
                test_pipeline.printout_graph(tempdir + "flowchart.unknown", no_key_legend = False)
                raise Exception("Failed to throw exception for test_pipeline.printout_graph unknown extension ")
            except CalledProcessError as err:
                pass
            test_pipeline.printout_graph(tempdir + "flowchart.unknown", "svg", no_key_legend = False)

        else:
            test_pipeline.printout_graph(tempdir + "flowchart.dot",
                                        target_tasks =[subdivide_start],
                                        forcedtorun_tasks = [split_start],
                                        no_key_legend = True)
開發者ID:Genomicsplc,項目名稱:ruffus,代碼行數:31,代碼來源:test_pipeline_printout_graph.py


注:本文中的ruffus.Pipeline.printout_graph方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。