当前位置: 首页>>代码示例>>Python>>正文


Python Connector.submitJobLocally方法代码示例

本文整理汇总了Python中connector.Connector.submitJobLocally方法的典型用法代码示例。如果您正苦于以下问题:Python Connector.submitJobLocally方法的具体用法?Python Connector.submitJobLocally怎么用?Python Connector.submitJobLocally使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在connector.Connector的用法示例。


在下文中一共展示了Connector.submitJobLocally方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MainWindow

# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import submitJobLocally [as 别名]

#.........这里部分代码省略.........
            else:
                self.jobname_str = str(self.jobname.text())
            
        if not Prj2sinWrap.createCommand(self):  # returns True if cmd was created
            return 
        
        if self.print_cmd.isChecked():  # prints full CLS if checked 
            if not self.debugTextField():
                 return
        
        if self.job.submitJob(Prj2sinWrap.cmd):
            self.statusBar().showMessage('Job successfully submitted: '+ \
                                         strftime('%H:%M:%S - %x'))
            
            
    def calcSingleSlice(self):
        '''
        This method is launched when pressing "Single Slice" button
        from the GUI. It's similar to "submitToCluster", however, it
        doesn't utilize the "createCommand" method. Instead, it creates
        the command line string (CLS) by calling
        "createSingleSliceCommand" and in the end displays the image.
        '''
        Prj2sinWrap.createSingleSliceCommand(self)

        if self.print_cmd.isChecked():
            if not self.debugTextField():
                 return

        # Create path for reconstructed single slice image
        self.dirs.createSingleSliceImagePath()
        
        if self.openinfiji.isChecked():
            self.job.submitJobLocallyAndWait('fiji -eval \"close(\\"'+ \
                                    str(self.prefix.text())+'*\\");\"')
        
        if self.dirs.checkIfFileExist(self.dirs.img_reco):
            self.job.submitJobLocallyAndWait('rm '+self.dirs.img_reco)
        
        # after all checks completed, singleSliceFunc is called and we wait until image is done
        self.job.submitJob(Prj2sinWrap.cmd)
        
        for kk in range(30):
            if self.dirs.checkIfFileExist(self.dirs.img_reco):
                break
            else:
                sleep(0.5)
        else:
            self.displayErrorMessage('No reconstructed slice found', \
                'After waiting 15 sec the reconstructed slice was not found')
            return
                                    
        # we display the image
        if self.openinfiji.isChecked():
            self.job.submitJobLocally('fiji -eval \"open(\\"'+self.dirs.img_reco+'\\")\"')
        else:
            self.displayImageBig(self.dirs.img_reco)
        
        
    def checkComputingLocation(self):
        '''
        This method makes sure that the radiobox from where GRecoMan is
        run, is checked because it is needed for creating the correct
        directory paths.
        '''
        if not self.afsaccount.isChecked() and not self.cons2.isChecked():
开发者ID:habi,项目名称:grecoman,代码行数:70,代码来源:main.py

示例2: MainWindow

# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import submitJobLocally [as 别名]

#.........这里部分代码省略.........
        ParameterWrap()(self,'fltp_fromtif','',['cprdirectory'],False)
        
 
    def submitToCluster(self):
        '''
        method that launches all the checks and if successful submits the
        command to cons-2 for starting the job
        '''
        if not self.checkAllParamters():
            return
        
        # (1) Create command line string
        if not str(self.jobname.text()):
            self.jobname_str = 'GRecoM'
        else:
            self.jobname_str = str(self.jobname.text())
            
        self.cmd = ''
        if not self.createCommand():
            return
        
        if self.print_cmd.isChecked():
            if not self.displayYesNoMessage('Submit to cons-2?', self.cmd):
                return
        
        # (2) run SSH-connector and check all account credentials
        if not self.job.performInitalCheck():
            return
        
        # (3) run SSh-connector to launch the job
        if self.afsaccount.isChecked():
            self.job.submitJobViaGateway(self.cmd+'\n','x02da-gw','x02da-cons-2')
        elif self.cons2.isChecked():
            self.job.submitJobLocally(self.cmd)
            
            
    def calcSingleSlice(self):
        '''
        method for renconstructing a single slice for a given sinogram.
        '''
        if not str(self.sinograms.currentText()):
            self.displayErrorMessage('No sinogram selected', 'Select the Sinogram directory and press Enter. Then select one to be reconstructed.')
            return
        
        ## (1) check whether we have defined the location from where we run the reconstruction
        if not self.checkComputingLocation():
            return
        
        ## (2) before calculating on x02da-cons-2, we need to rewrite the path of the sino dir
        if self.afsaccount.isChecked():
            single_sino = self.dirs.afsPath2Cons2(self.sinogramdirectory.text())
        elif self.cons2.isChecked():
            single_sino = str(self.sinogramdirectory.text())

        ## (3) create the command line string for single slice reconstruction
        self.cmd_string = 'python /afs/psi.ch/project/tomcatsvn/executeables/grecoman/externals/singleSliceFunc.py '
        
        combos_single = ['filter','geometry']  # removed: 'outputtype' (let's always have DMP!)
        for combo in combos_single:
            if ParameterWrap.par_dict[combo].performCheck():
                self.cmd_string += ParameterWrap.par_dict[combo].flag+' '+self.getComboBoxContent(combo)+' ' 
        
        if self.zingeron.isChecked():
            self.setZingerParameters()
        
        optional_single = ['cutofffrequency','edgepadding','centerofrotation','rotationangle']
开发者ID:arcaduf,项目名称:grecoman,代码行数:70,代码来源:grecoman.py


注:本文中的connector.Connector.submitJobLocally方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。