当前位置: 首页>>代码示例>>Python>>正文


Python WorkflowGraph.add方法代码示例

本文整理汇总了Python中dispel4py.workflow_graph.WorkflowGraph.add方法的典型用法代码示例。如果您正苦于以下问题:Python WorkflowGraph.add方法的具体用法?Python WorkflowGraph.add怎么用?Python WorkflowGraph.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dispel4py.workflow_graph.WorkflowGraph的用法示例。


在下文中一共展示了WorkflowGraph.add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_input_iter_one

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import add [as 别名]
def test_input_iter_one():
    args = argparse.Namespace
    args.file = None
    args.data = None
    args.iter = 1
    graph = WorkflowGraph()
    prod = TestProducer()
    graph.add(prod)
    inputs = p.create_inputs(args, graph)
    tools.eq_(inputs[prod.id], 1)
开发者ID:rosafilgueira,项目名称:dispel4py,代码行数:12,代码来源:processor_test.py

示例2: test_input_file

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import add [as 别名]
def test_input_file():
    args = argparse.Namespace
    import tempfile
    namedfile = tempfile.NamedTemporaryFile()
    with namedfile as temp:
        data = '{ "TestProducer": 20}'
        try:
            temp.write(data)
        except:
            temp.write(bytes(data, 'UTF-8'))
        temp.flush()
        temp.seek(0)
        args.file = namedfile.name
        args.data = None
        args.iter = 1
        graph = WorkflowGraph()
        prod = TestProducer()
        graph.add(prod)
        inputs = p.create_inputs(args, graph)
        tools.eq_(inputs[prod.id], 20)
开发者ID:rosafilgueira,项目名称:dispel4py,代码行数:22,代码来源:processor_test.py

示例3: SimpleFunctionPE

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import add [as 别名]
waveformr = SimpleFunctionPE(waveform_reader)
xmlr = SimpleFunctionPE(stationxml_reader)
downloadPE = SimpleFunctionPE(download_data)

processes=[waveform_reader,(plot_stream,{"source":"waveform_reader","output_dir": "./output-images","tag": "observed-image"})]
            
#processes.append((fn, params))
chain = create_iterative_chain(processes, FunctionPE_class=SimpleFunctionPE)



watcher = WatchDirectory(0)
watcher_xml = WatchDirectory(1)
downloadPE.name = "downloadPE"
graph = WorkflowGraph()
graph.add(downloadPE)

graph.connect(downloadPE, 'output', watcher, "input")
graph.connect(downloadPE, 'output', watcher_xml, "input")
graph.connect(watcher, 'output', chain, "input")
graph.connect(watcher_xml, 'output', xmlr, "input")

#injectProv(graph,SeismoPE)
#graph=attachProvenanceRecorderPE(graph,ProvenanceRecorderToFileBulk,username=os.environ['USER_NAME'],runId=os.environ['RUN_ID'])


#Store to local path
ProvenancePE.PROV_PATH=os.environ['PROV_PATH']

#Size of the provenance bulk before sent to storage or sensor
ProvenancePE.BULK_SIZE=20
开发者ID:aspinuso,项目名称:VERCE,代码行数:33,代码来源:test_downloading_dispel4py.py

示例4: testOnePE

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import add [as 别名]
def testOnePE():
    graph = WorkflowGraph()
    prod = TestProducer()
    graph.add(prod)
    results = simple_process.process(graph, { prod: [{}] })
    tools.eq_({(prod.id, 'output'):[1]}, results)
开发者ID:Ravanon,项目名称:dispel4py,代码行数:8,代码来源:simple_process_test.py


注:本文中的dispel4py.workflow_graph.WorkflowGraph.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。