def _get_pipeline(self): from core.vistrail.pipeline import Pipeline import db.services.vistrail workflow = db.services.vistrail.materializeWorkflow(self.abstraction, self.version) Pipeline.convert(workflow) return workflow
def getPipeline(actions): from db.domain import DBWorkflow from db.services.vistrail import performActions from core.vistrail.pipeline import Pipeline workflow = DBWorkflow() performActions(actions, workflow) Pipeline.convert(workflow) return workflow
def get_workflow_diff(vt, v1, v2): from core.vistrail.pipeline import Pipeline (v1, v2, pairs, v1Only, v2Only, paramChanges, _, _, _) = \ db.services.vistrail.getWorkflowDiff(vt, v1, v2, True) Pipeline.convert(v1) v1.set_abstraction_map(vt.abstractionMap) Pipeline.convert(v2) v2.set_abstraction_map(vt.abstractionMap) # print 'pairs:', pairs # print 'v1Only:', v1Only # print 'v2Only:', v2Only # print 'paramChanges:', paramChanges return (v1, v2, pairs, v1Only, v2Only, paramChanges)
def get_workflow_diff_with_connections(vt_pair_1, vt_pair_2): """get_workflow_diff_with_connections Similar to get_workflow_diff but with connection pairings. """ from core.vistrail.pipeline import Pipeline (v1, v2, m_pairs, m_heuristic, v1_only, v2_only, param_changes, \ c_pairs, c_heuristic, c1_only, c2_only) = \ db.services.vistrail.getWorkflowDiff(vt_pair_1, vt_pair_2, False) Pipeline.convert(v1) Pipeline.convert(v2) return (v1, v2, m_pairs, m_heustric, v1_only, v2_only, param_changes, c_pairs, c_heuristic, c1_only, c2_only)
def convert(_group): if _group.__class__ == Group: return _group.__class__ = Group if _group.db_location: Location.convert(_group.db_location) if _group.db_workflow: from core.vistrail.pipeline import Pipeline Pipeline.convert(_group.db_workflow) for _function in _group.db_functions: ModuleFunction.convert(_function) for _annotation in _group.db_get_annotations(): Annotation.convert(_annotation) _group.set_defaults()
def get_workflow_diff(vt_pair_1, vt_pair_2): """get_workflow_diff( tuple(Vistrail, id), tuple(Vistrail, id) ) -> Pipeline, Pipeline, [tuple(id, id)], [tuple(id, id)], [id], [id], [tuple(id, id, list)] Return a difference between two workflows referenced as vistrails. """ from core.vistrail.pipeline import Pipeline (v1, v2, pairs, heuristic_pairs, v1_only, v2_only, param_changes, \ _, _, _, _) = \ db.services.vistrail.getWorkflowDiff(vt_pair_1, vt_pair_2, True) Pipeline.convert(v1) Pipeline.convert(v2) return (v1, v2, pairs, heuristic_pairs, v1_only, v2_only, param_changes)
def convert(_group): if _group.__class__ == Group: return _group.__class__ = Group _group._registry = None _group.portVisible = set() if _group.db_location: Location.convert(_group.db_location) if _group.db_workflow: from core.vistrail.pipeline import Pipeline Pipeline.convert(_group.db_workflow) for _function in _group.db_functions: ModuleFunction.convert(_function) for _annotation in _group.db_get_annotations(): Annotation.convert(_annotation)
def get_workflow_diff_with_connections(vt, v1, v2): from core.vistrail.pipeline import Pipeline (v1, v2, mPairs, v1Only, v2Only, paramChanges, cPairs, c1Only, c2Only) = \ db.services.vistrail.getWorkflowDiff(vt, v1, v2, False) Pipeline.convert(v1) v1.set_abstraction_map(vt.abstractionMap) Pipeline.convert(v2) v2.set_abstraction_map(vt.abstractionMap) # print 'mPairs:', mPairs # print 'v1Only:', v1Only # print 'v2Only:', v2Only # print 'paramChanges:', paramChanges # print 'cPairs:', cPairs # print 'c1Only:', c1Only # print 'c2Only:', c2Only return (v1, v2, pairs, v1Only, v2Only, paramChanges, cPairs, c1Only, c2Only)
def open_workflow(filename): from core.vistrail.pipeline import Pipeline workflow = db.services.io.open_workflow_from_xml(filename) Pipeline.convert(workflow) return workflow
def get_workflow(vt, version): from core.vistrail.pipeline import Pipeline workflow = db.services.vistrail.materializeWorkflow(vt, version) Pipeline.convert(workflow) return workflow
def expand_workflow(vt, workflow=None, version=None): from core.vistrail.pipeline import Pipeline (workflow, module_remap) = \ db.services.vistrail.expandWorkflow(vt, workflow, version) Pipeline.convert(workflow) return (workflow, module_remap)