def _data_dialog(self): ''' a dialog for data processing ''' self.progress_processing.setHidden(True) self.progress_processing.setMinimum(0) self.progress_processing.setValue(0) self.tasks = transport.get_result_files(self.work_dir, self.substances) n_tas = len(self.tasks) self.solutions = transport.parse_task_dirs(self.work_dir, FNAME_ELEMS) n_sols = len(self.solutions) if n_tas - n_sols == 0: self.button_process_newonly.setHidden(True) self.button_process_all.setText('Start') else: self.button_process_newonly.setVisible(True) self.button_process_all.setText('All') msg = "Found {} tasks to analyze. It may take a while\n".format(n_tas) msg += "{} tasks was already processed (compressed file found), {} still need processing\n".format( n_sols, n_tas - n_sols) if self.substances and n_sols > 0: msg += "\n\nYour task works with multiple substances. Now you close this primary task and open result for single substance in subfolder." self.label_processing_text.setText(msg) self.progress_processing.setMaximum(n_tas * 4)
def _analyze_data_selected(self): ''' action for button_process_newonly takes only unprocessed tasks in work_dir to process ''' if not self.tasks: self.tasks = transport.get_result_files( self.work_dir, self.substances) if not self.solutions: self.solutions = transport.parse_task_dirs( self.work_dir, FNAME_ELEMS) dir1 = [path.split(sol)[0] for sol in self.solutions] dir2 = [path.split(sol)[0] for sol in self.tasks] unproc_list = [transport.get_result_files(i, self.substances)[0] for i in dir2 if i not in dir1] self.messenger('Processing data, it may take a while') self._analyze_data_routine(unproc_list) self.messenger('Processing successfully finished', 300) self._data_dialog()
def _analyze_data(self): ''' action for button_process_all takes all tasks in work_dir to process ''' if not self.tasks: self.tasks = transport.get_result_files( self.work_dir, self.substances) self.messenger('Processing data, it may take a while') self._analyze_data_routine(self.tasks) self.messenger('Processing successfully finished', 300) self._data_dialog()