本文整理汇总了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)
示例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)
示例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
示例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)