本文整理汇总了Python中vistrails.core.vistrail.controller.VistrailController.perform_action方法的典型用法代码示例。如果您正苦于以下问题:Python VistrailController.perform_action方法的具体用法?Python VistrailController.perform_action怎么用?Python VistrailController.perform_action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vistrails.core.vistrail.controller.VistrailController
的用法示例。
在下文中一共展示了VistrailController.perform_action方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pipeline_from_generator
# 需要导入模块: from vistrails.core.vistrail.controller import VistrailController [as 别名]
# 或者: from vistrails.core.vistrail.controller.VistrailController import perform_action [as 别名]
def pipeline_from_generator(variable_gen):
# Get the original OutputPort module
orig_controller = variable_gen._generator.controller
base_pipeline = orig_controller.vistrail.getPipeline('dat-vars')
if len(base_pipeline.module_list) != 1:
raise ValueError("dat-vars version is invalid")
output_port = base_pipeline.module_list[0]
controller = VistrailController(Vistrail())
# OutputPort
operations = [('add', output_port)]
# Rest of the pipeline
operations += variable_gen._generator.operations
# Connection
connection = controller.create_connection(
variable_gen._output_module,
variable_gen._outputport_name,
output_port,
'InternalPipe')
operations.append(('add', connection))
# Materialize this
action = create_action(operations)
controller.add_new_action(action)
version = controller.perform_action(action)
controller.change_selected_version(version)
assert version == controller.current_version == 1
return controller.current_pipeline, 1