Example #1
0
    def execute(self):
        """ execute() -> None        
        Perform the exploration by collecting a list of actions
        corresponding to each dimension
        
        """
        # persist the parameter exploration
        pe = self.getParameterExploration()
        pe.action_id = self.controller.current_version

        # check if pe has changed
        changed = False
        if not self.controller.current_parameter_exploration or \
         pe != self.controller.current_parameter_exploration:
            changed = True
            pe.name = ''
            self.controller.current_parameter_exploration = pe
            self.controller.vistrail.add_paramexp(pe)
            self.controller.set_changed(True)
        else:
            pe = self.controller.current_parameter_exploration

        errors = self.controller.executeParameterExploration(
            pe,
            self.get_param_view().pipeline_view.scene())
        if errors:
            errors = '\n'.join(
                ['Position %s: %s' % (error[0], error[1]) for error in errors])
            debug.critical("Parameter Exploration Execution had errors",
                           errors)
        if changed:
            from vistrails.gui.vistrails_window import _app
            _app.notify('exploration_changed')
Example #2
0
    def execute(self):
        """ execute() -> None        
        Perform the exploration by collecting a list of actions
        corresponding to each dimension
        
        """
        # persist the parameter exploration
        pe = self.getParameterExploration()
        pe.action_id = self.controller.current_version

        # check if pe has changed
        changed = False
        if not self.controller.current_parameter_exploration or \
         pe != self.controller.current_parameter_exploration:
            changed = True
            pe.name = ''
            self.controller.current_parameter_exploration = pe
            self.controller.vistrail.add_paramexp(pe)
            self.controller.set_changed(True)
        else:
            pe = self.controller.current_parameter_exploration

        errors = self.controller.executeParameterExploration(pe,
                                     self.get_param_view().pipeline_view.scene())
        if errors:
            errors = '\n'.join(['Position %s: %s' % (error[0], error[1]) for error in errors])
            debug.critical("Parameter Exploration Execution had errors", errors)
        if changed:
            from vistrails.gui.vistrails_window import _app
            _app.notify('exploration_changed')
Example #3
0
    def updateVersion(self):
        self.pe = None
        if self.controller:
            # Check if version changed
            version_changed = False
            if self.controller.current_parameter_exploration and \
               self.controller.current_parameter_exploration.action_id !=\
                self.controller.current_version:
                # we need to remove it
                version_changed = True
                self.controller.current_parameter_exploration = None

            if not self.controller.current_parameter_exploration and \
                self.controller.vistrail.has_paramexp(
                                             self.controller.current_version):
                version_changed = True
                # load latest version
                self.controller.current_parameter_exploration = \
                            self.controller.vistrail.get_paramexp(
                                              self.controller.current_version)

            if version_changed:
                from vistrails.gui.vistrails_window import _app
                _app.notify('exploration_changed')
                return

            self.pe = self.controller.current_parameter_exploration
        if self.controller and self.pe:
            # get all pe for this action
            self.peDict = dict([
                (pe.id, pe)
                for pe in self.controller.vistrail.parameter_explorations
                if pe.action_id == self.pe.action_id
            ])
            count = len(self.peDict)
            ids = self.peDict.keys()
            ids.sort()
            index = ids.index(self.pe.id) + 1

            text = 'Exploration: %s/%s' % (index, count)
            self.versionsLabel.setText(text)
            self.backAction.setEnabled(index > 1)
            self.forwardAction.setEnabled(index < count)
            self.tagEdit.setEnabled(True)
            self.tagReset.setEnabled(True)
            self.tagEdit.setText(self.pe.name or "")
            self.userEdit.setText(self.pe.user or "")
            self.dateEdit.setText(
                self.pe.date.strftime('%Y-%m-%d %H:%M:%S') if self.pe.
                date else "")
        else:
            self.versionsLabel.setText('Exploration: 0/0')
            self.backAction.setEnabled(False)
            self.forwardAction.setEnabled(False)
            self.tagEdit.setEnabled(False)
            self.tagReset.setEnabled(False)
            self.tagEdit.setText('')
            self.userEdit.setText('')
            self.dateEdit.setText('')
Example #4
0
 def notify_app(self, wf_execution, execution):
     # make sure it is only called once
     if self.isUpdating:
         return
     self.isUpdating = True
     from vistrails.gui.vistrails_window import _app
     _app.notify("execution_changed", wf_execution, execution)
     self.isUpdating = False
Example #5
0
 def notify_app(self, wf_item, execution):
     # make sure it is only called once
     if self.isUpdating:
         return
     self.isUpdating = True
     from vistrails.gui.vistrails_window import _app
     _app.notify("execution_changed", wf_item, execution)
     self.isUpdating = False
Example #6
0
    def set_to_search_mode(self):
        self.set_display_view(QQueryView.VISUAL_SEARCH_VIEW)
        self.query_box.backButton.setEnabled(False)
        self.query_box.editButton.setEnabled(False)
        self.set_reset_button(self.p_controller.current_pipeline)

        from vistrails.gui.vistrails_window import _app
        _app.notify('query_pipeline_changed',
                    self.p_controller.current_pipeline)
    def set_to_search_mode(self):
        self.set_display_view(QQueryView.VISUAL_SEARCH_VIEW)
        self.query_box.backButton.setEnabled(False)
        self.query_box.editButton.setEnabled(False)
        self.set_reset_button(self.p_controller.current_pipeline)

        from vistrails.gui.vistrails_window import _app
        _app.notify('query_pipeline_changed', 
                    self.p_controller.current_pipeline)
Example #8
0
    def updateVersion(self):
        self.pe = None
        if self.controller:
            # Check if version changed
            version_changed = False
            if self.controller.current_parameter_exploration and \
               self.controller.current_parameter_exploration.action_id !=\
                self.controller.current_version:
                # we need to remove it
                version_changed = True
                self.controller.current_parameter_exploration=None
            
            if not self.controller.current_parameter_exploration and \
                self.controller.vistrail.has_paramexp(
                                             self.controller.current_version):
                version_changed = True
                # load latest version
                self.controller.current_parameter_exploration = \
                            self.controller.vistrail.get_paramexp(
                                              self.controller.current_version)

            if version_changed:
                from vistrails.gui.vistrails_window import _app
                _app.notify('exploration_changed')
                return

            self.pe = self.controller.current_parameter_exploration
        if self.controller and self.pe:
            # get all pe for this action
            self.peDict = dict([(pe.id, pe) for pe in
                            self.controller.vistrail.parameter_explorations
                            if pe.action_id==self.pe.action_id])
            count = len(self.peDict)
            ids = self.peDict.keys()
            ids.sort()
            index = ids.index(self.pe.id) + 1
            
            text = 'Exploration: %s/%s' % (index, count)
            self.versionsLabel.setText(text)
            self.backAction.setEnabled(index>1)
            self.forwardAction.setEnabled(index<count)
            self.tagEdit.setEnabled(True)
            self.tagReset.setEnabled(True)
            self.tagEdit.setText(self.pe.name or "")
            self.userEdit.setText(self.pe.user or "")
            self.dateEdit.setText(self.pe.date.strftime('%Y-%m-%d %H:%M:%S')
                                  if self.pe.date else "")
        else:
            self.versionsLabel.setText('Exploration: 0/0')
            self.backAction.setEnabled(False)
            self.forwardAction.setEnabled(False)
            self.tagEdit.setEnabled(False)
            self.tagReset.setEnabled(False)
            self.tagEdit.setText('')
            self.userEdit.setText('')
            self.dateEdit.setText('')  
Example #9
0
 def goBack(self):
     """ Goes to the previous PE for this pipeline"""
     ids = self.peDict.keys()
     ids.sort()
     index = ids.index(self.pe.id)
     if index>0:
         pe = self.peDict[ids[index-1]]
         self.controller.current_parameter_exploration = pe
         from vistrails.gui.vistrails_window import _app
         _app.notify('exploration_changed')
Example #10
0
    def set_to_result_mode(self):
        self.set_display_view(self.current_result_view)
        self.query_box.backButton.setEnabled(True)
        if self.query_controller.level >= QueryController.LEVEL_VISTRAIL:
            self.query_box.editButton.setEnabled(True)
        self.query_box.setManualResetEnabled(True)

        from vistrails.gui.vistrails_window import _app
        _app.notify('query_pipeline_changed',
                    self.p_controller.current_pipeline)
Example #11
0
 def goBack(self):
     """ Goes to the previous PE for this pipeline"""
     ids = self.peDict.keys()
     ids.sort()
     index = ids.index(self.pe.id)
     if index>0:
         pe = self.peDict[ids[index-1]]
         self.controller.current_parameter_exploration = pe
         from vistrails.gui.vistrails_window import _app
         _app.notify('exploration_changed')
    def set_to_result_mode(self):
        self.set_display_view(self.current_result_view)
        self.query_box.backButton.setEnabled(True)
        if self.query_controller.level >= QueryController.LEVEL_VISTRAIL:
            self.query_box.editButton.setEnabled(True)
        self.query_box.setManualResetEnabled(True)

        from vistrails.gui.vistrails_window import _app
        _app.notify('query_pipeline_changed', 
                    self.p_controller.current_pipeline)
Example #13
0
 def goForward(self):
     """ Goes to the next PE for this pipeline"""
     count = len(self.peDict)
     ids = self.peDict.keys()
     ids.sort()
     index = ids.index(self.pe.id)
     if index<count-1:
         pe = self.peDict[ids[index+1]]
         self.controller.current_parameter_exploration = pe
         from vistrails.gui.vistrails_window import _app
         _app.notify('exploration_changed')
Example #14
0
 def goForward(self):
     """ Goes to the next PE for this pipeline"""
     count = len(self.peDict)
     ids = self.peDict.keys()
     ids.sort()
     index = ids.index(self.pe.id)
     if index<count-1:
         pe = self.peDict[ids[index+1]]
         self.controller.current_parameter_exploration = pe
         from vistrails.gui.vistrails_window import _app
         _app.notify('exploration_changed')
    def reset_search(self):
        self.search = None
        self.search_pipeline = None
        self.query_view.pipeline_view.controller.change_selected_version(0)
        self.query_view.pipeline_view.scene().setupScene(
            self.query_view.pipeline_view.controller.current_pipeline)
        self.query_view.set_to_search_mode()
        self.query_view.query_box.searchBox.clearSearch()
        self.query_view.vistrailChanged()

        from vistrails.gui.vistrails_window import _app
        _app.notify("search_changed", None, None)
Example #16
0
    def reset_search(self):
        self.search = None
        self.search_pipeline = None
        self.query_view.pipeline_view.controller.change_selected_version(0)
        self.query_view.pipeline_view.scene().setupScene(
            self.query_view.pipeline_view.controller.current_pipeline)
        self.query_view.set_to_search_mode()
        self.query_view.query_box.searchBox.clearSearch()
        self.query_view.vistrailChanged()

        from vistrails.gui.vistrails_window import _app
        _app.notify("search_changed", None, None)
Example #17
0
 def exploreChange(self, on):
     from vistrails.gui.vistrails_window import _app
     _app.notify('explore_changed', on)
 def vistrailChanged(self):
     from vistrails.gui.vistrails_window import _app
     self.p_controller.current_pipeline.ensure_connection_specs()
     _app.notify('query_pipeline_changed', self.p_controller.current_pipeline)
Example #19
0
 def vistrailChanged(self):
     from vistrails.gui.vistrails_window import _app
     self.p_controller.current_pipeline.ensure_connection_specs()
     _app.notify('query_pipeline_changed',
                 self.p_controller.current_pipeline)
    def run_search(self, search_str=None):
        """ set_search(search_str: str) -> None
        Change the currrent version tree search statement
        
        """
        search_pipeline = \
            self.query_view.pipeline_view.scene().current_pipeline
        if search_str is None:
            search_str = self.query_view.query_box.getCurrentText()
        self.query_view.update_controller()
        if self.search is None or \
                self.search.search_str != search_str or \
                self.search.queryPipeline != search_pipeline or \
                self.query_view.p_controller.changed or \
                self.search_level > self.level:
            self.search_str = search_str
            self.search_pipeline = search_pipeline
            self.search_level = self.level
            # reset changed here
            self.query_view.p_controller.set_changed(False)
            vt_controller = self.query_view.vt_controller
            current_vistrail = self.vt_controller.vistrail

            def do_search(only_current_vistrail=False, 
                          only_current_workflow=False):
                entities_to_check = {}
                open_col = Collection.getInstance()
                
                for entity in open_col.get_current_entities():
                    if entity.type_id == VistrailEntity.type_id and \
                            entity.is_open:
                        controller = entity._window.controller
                        if only_current_vistrail and \
                                controller.vistrail != vt_controller.vistrail:
                            continue
                        if only_current_workflow:
                            versions_to_check = controller.current_version
                        else:
                            graph = controller._current_terse_graph
                            versions_to_check = set(graph.vertices.iterkeys())
                        entities_to_check[entity] = versions_to_check
                self.set_search(MultipleSearch(search_str, search_pipeline,
                                               entities_to_check))
                self.search.run()
                return self.search.getResultEntities()
                
            if self.level == QueryController.LEVEL_VISTRAIL:
                result_entities = do_search(True)                
                self.show_vistrail_matches()
            elif self.level == QueryController.LEVEL_WORKFLOW:
                self.search_level = QueryController.LEVEL_VISTRAIL
                result_entities = do_search(True)
                self.update_version_tree()
                self.show_workflow_matches()
            elif self.level == QueryController.LEVEL_ALL:
                result_entities = do_search()
                self.show_global_matches()

            from vistrails.gui.vistrails_window import _app
            _app.notify("search_changed", self.search, result_entities)
        else:
            self.query_view.set_to_result_mode()
Example #21
0
 def configureDone(self):
     from vistrails.gui.vistrails_window import _app
     self.emit(QtCore.SIGNAL('doneConfigure'), self.module.id)
     _app.notify('module_done_configure', self.module.id)
Example #22
0
    def run_search(self, search_str=None):
        """ set_search(search_str: str) -> None
        Change the currrent version tree search statement
        
        """
        search_pipeline = \
            self.query_view.pipeline_view.scene().current_pipeline
        if search_str is None:
            search_str = self.query_view.query_box.getCurrentText()
        self.query_view.update_controller()
        if self.search is None or \
                self.search.search_str != search_str or \
                self.search.queryPipeline != search_pipeline or \
                self.search.use_regex != self.use_regex or \
                self.query_view.p_controller.changed or \
                self.search_level > self.level:
            self.search_str = search_str
            self.search_pipeline = search_pipeline
            self.search_level = self.level
            # reset changed here
            self.query_view.p_controller.set_changed(False)
            vt_controller = self.query_view.vt_controller
            controllers = []

            def do_search(only_current_vistrail=False,
                          only_current_workflow=False):
                entities_to_check = {}
                open_col = Collection.getInstance()

                for entity in open_col.get_current_entities():
                    if entity.type_id == VistrailEntity.type_id and \
                            entity.is_open:
                        controller = entity._window.controller
                        if only_current_vistrail and \
                                controller.vistrail != vt_controller.vistrail:
                            continue
                        controllers.append(controller)
                        if only_current_workflow:
                            versions_to_check = set(
                                [controller.current_version])
                        else:
                            graph = controller._current_terse_graph
                            versions_to_check = set(graph.vertices.iterkeys())
                        entities_to_check[entity] = versions_to_check
                self.set_search(
                    MultipleSearch(search_str, search_pipeline,
                                   entities_to_check, self.use_regex))
                self.search.run()
                return self.search.getResultEntities()

            if self.level == QueryController.LEVEL_VISTRAIL:
                result_entities = do_search(True)
                self.show_vistrail_matches()
            elif self.level == QueryController.LEVEL_WORKFLOW:
                #self.search_level = QueryController.LEVEL_VISTRAIL
                result_entities = do_search(False, True)
                self.update_version_tree()
                self.show_workflow_matches()
            else:  # self.level == QueryController.LEVEL_ALL
                result_entities = do_search()
                self.show_global_matches()

            from vistrails.gui.vistrails_window import _app
            _app.notify("search_changed", self.search, result_entities)
            # May need to update version trees
            # resultEntities make sure no update is created later
            for controller in controllers:
                controller.check_delayed_update()
        else:
            self.query_view.set_to_result_mode()
Example #23
0
 def execute(self, params):
     from vistrails.gui.vistrails_window import _app
     result = BaseController.execute(self, params)
     _app.notify('execution_updated')
     return result
 def configureDone(self):
     from vistrails.gui.vistrails_window import _app
     self.emit(QtCore.SIGNAL('doneConfigure'), self.module.id)  
     _app.notify('module_done_configure', self.module.id)
Example #25
0
 def execute(self):
     res = self.controller.execute_user_workflow()
     from vistrails.gui.vistrails_window import _app
     if len(res[0][0].errors) > 0:
         _app.qactions['pipeline'].trigger()
     _app.notify('execution_updated')
Example #26
0
 def execute(self):
     res = self.controller.execute_user_workflow()
     from vistrails.gui.vistrails_window import _app
     if len(res[0][0].errors) > 0:
         _app.qactions['pipeline'].trigger()
     _app.notify('execution_updated')
Example #27
0
 def execute(self, params):
     from vistrails.gui.vistrails_window import _app
     result = BaseController.execute(self, params)
     _app.notify('execution_updated')
     return result
Example #28
0
    def aliasChanged(self, param):
        from vistrails.gui.vistrails_window import _app

        _app.notify("alias_changed", param)
 def aliasChanged(self, param):
     from vistrails.gui.vistrails_window import _app
     _app.notify('alias_changed', param)
Example #30
0
 def exploreChange(self, on):
     from vistrails.gui.vistrails_window import _app
     _app.notify('explore_changed', on)