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


Python EDPlugin.process方法代码示例

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


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

示例1: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
 def process(self, _edObject=None):
     EDPlugin.process(self)
     self.DEBUG("EDPluginWaitFile.process")
     self.DEBUG("EDPluginWaitFile Plugin TimeOut is set to: %s, internal TimeOut is %s" % (self.getTimeOut(), self.__timeout))
     self.setTimeInit()
     dirname = os.path.dirname(self.__filename)
     while self.getRunTime() < self.__timeout:
         if os.path.isdir(dirname):
             fd = os.open(dirname, os.O_RDONLY)
             os.fstat(fd)
             os.close(fd)
             if os.path.exists(self.__filename):
                 self.__filesize = os.path.getsize(self.__filename)
                 if self.__filesize >= self.__expectedSize:
                     break
         time.sleep(EDPluginWaitFile.DELTA_TIME)
     self.setTimeEnd()
开发者ID:gbourgh,项目名称:edna,代码行数:19,代码来源:EDPluginWaitFile.py

示例2: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
    def process(self, _edObject=None):
        EDPlugin.process(self)

        output = XSDataXscaleParsedOutput()

        # get all the file's contents, find where the info is and then
        # use helper functions to retrieve stuff and put it in the
        # data model
        try:
            f = open(self.dataInput.lp_file.value, 'r')
            lines = f.readlines()
        except IOError:
            strErrorMessage = "Input file {0} could not be opened".format(self.dataInput.lp_file.value)
            self.ERROR(strErrorMessage)
            self.addErrorMessage(strErrorMessage)
            self.setFailure()
            return

        # look for the stats table
        info_begin = None
        info_end = None
        started = False
        for line_no, line in enumerate(lines):
            if line.find('LIMIT     OBSERVED  UNIQUE  POSSIBLE     OF DATA   observed  expected') != -1:
                # there's an empty line after the header
                info_begin = line_no + 2
            if info_begin is not None and line.find('total') != -1:
                # we're at the last table line
                info_end = line_no
                # stop here as there are some other lines containing
                # "total" later
                break
        if info_begin is None or info_end is None:
            strErrorMessage = "Could not find the completeness table"
            self.ERROR(strErrorMessage)
            self.addErrorMessage(strErrorMessage)
            self.setFailure()
            return

        _extract_completeness_entries(lines[info_begin:info_end + 1], output)

        input_file = self.dataInput.lp_file.value
        output.xds_run_directory = XSDataString(os.path.dirname(input_file))
        self.dataOutput = output
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:46,代码来源:EDPluginParseXscaleOutputv1_0.py

示例3: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
    def process(self, _edObject=None):
        EDPlugin.process(self)
        self.DEBUG("EDPluginAccumulatorv1_0.process")
        queriesToRemove = []
        listXsdQuery = []
        if not self.flush:
            self.__semaphore.acquire()
            for query in self.__queries:
                present = True
                for item in query:
                    if not item in self.__items:
                        present = False
                        break
                if present is True:
                    queriesToRemove.append(query)
                    xsdQuery = XSDataQuery()
                    xsdQuery.setItem([XSDataString(item) for item in query])
                    if self.__queries[query] is True:
                        xsdQuery.setRemoveItems(XSDataBoolean(True))
                        for item in query:
                            self.__items.remove(item)
                    else:
                        xsdQuery.setRemoveItems(XSDataBoolean(False))
                    listXsdQuery.append(xsdQuery)

#Remove the query from the list of queries
            for query in queriesToRemove:
                self.__queries.pop(query)
            self.__semaphore.release()
        else:
            xsdQuery = XSDataQuery()
            self.__semaphore.acquire()
            xsdQuery.setItem([XSDataString(item) for item in self.__items])
            xsdQuery.setRemoveItems(XSDataBoolean(True))
            self.__class__.__items = []
            self.__semaphore.release()
            listXsdQuery.append(xsdQuery)
        self.xsDataResult.setQuery(listXsdQuery)
开发者ID:olofsvensson,项目名称:edna-plugins-exec,代码行数:40,代码来源:EDPluginAccumulatorv1_0.py

示例4: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
    def process(self, _edObject = None):
        EDPlugin.process(self)

        output = XSDataXdsOutput()

        # get all the file's contents, find where the info is and then
        # use helper functions to retrieve stuff and put it in the
        # data model
        try:
            f = open(self.dataInput.correct_lp.path.value, 'r')
            lines = f.readlines()
        except IOError:
            EDVerbose.ERROR('Could not open the specified XDS output file for reading')
            self.setFailure()
            return

        # look for the "big piece of information"
        info_begin = None
        info_end = None
        for lineno, line in enumerate(lines):
            if info_begin is None:
                if line.find('REFINEMENT OF DIFFRACTION PARAMETERS USING ALL IMAGES') != -1:
                    info_begin = lineno
            else:
                if line.find('MEAN INTENSITY AS FUNCTION OF SPINDLE POSITION WITHIN DATA IMAGE') != -1:
                    info_end = lineno
                    break

        if info_begin is None or info_end is None:
            EDVerbose.ERROR('could not find the refined parameters')
            self.setFailure()
            return

        _extract_infos(lines[info_begin:info_end], output)

        # second pass, look for the interesting table
        info_begin = None
        info_end = None
        started = False
        for line_no, line in enumerate(lines):
            if line.find('REFLECTIONS OF TYPE H,0,0  0,K,0  0,0,L OR EXPECTED TO BE ABSENT (*)') != -1:
                # the table will start shortly after
                started = True
                continue
            if started:
                # look if we are at the table yet
                if line.find('LIMIT     OBSERVED  UNIQUE  POSSIBLE     OF DATA   observed  expected') != -1:
                    # there's an empty line after the header
                    info_begin = line_no + 2
                if info_begin is not None and line.find('total') != -1:
                    # we're at the last table line
                    info_end = line_no
        if info_begin is None or info_end is None:
            EDVerbose.ERROR('could not find the completeness table')
            self.setFailure()
            return

        _extract_completeness_entries(lines[info_begin:info_end+1], output)


        # now for the last bit: check if we were given a path to the
        # gxparm file and if it exists get the space group and unit
        # cell constants from it
        if self.dataInput.gxparm is not None:
            gxparm_path = self.dataInput.gxparm.path.value
            if os.path.exists(gxparm_path):
                with open(gxparm_path, 'r') as f:
                    lines = f.readlines()
                for line in lines:
                    # the one we want has 7 floats
                    chunks = line.split()
                    if len(chunks) == 7:
                        output.sg_number = XSDataInteger(int(chunks[0]))
                        output.unit_cell_constants = [XSDataFloat(float(x)) for x in chunks[1:]]


        input_file = self.dataInput.correct_lp.path.value
        output.xds_run_directory = XSDataString(os.path.dirname(input_file))
        self.dataOutput = output
开发者ID:edna-site,项目名称:edna,代码行数:81,代码来源:EDPluginParseXdsOutput.py

示例5: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
    def process(self, _edObject = None):
        EDPlugin.process(self)
        completeness_cutoff_param = self.dataInput.completeness_cutoff
        if completeness_cutoff_param is None:
            completeness_cutoff = 80
        else:
            completeness_cutoff = completeness_cutoff_param.value

        isig_cutoff_param = self.dataInput.isig_cutoff
        if isig_cutoff_param is None:
            isig_cutoff = 3
        else:
            isig_cutoff = isig_cutoff_param.value

        res_override = self.dataInput.res_override

        bins = list()

        # for the first iteration
        # comment from max's code: "less stringent at low res"
        local_completeness_cutoff = 70
        # declared but not initialized in the perl code
        prev_isig = prev_res = 0

        # XXX: if res is still not defined at the end it is set to
        # detector_max_res, which we should somehow defined (in the
        # data model?) and used as the default value before we start
        # the processing

        for entry in self.dataInput.completeness_entries:
            outer_res = entry.outer_res.value
            outer_complete = entry.outer_complete.value
            outer_rfactor = entry.outer_rfactor.value
            outer_isig = entry.outer_isig.value

            if outer_complete < local_completeness_cutoff or outer_isig < isig_cutoff or \
                    (res_override is not None and outer_res < res_override.value):
                if outer_complete < completeness_cutoff:
                    EDVerbose.DEBUG('incomplete data (%s) in this shell' % outer_complete)
                    res = prev_res
                else:
                    res = _calculate_res_from_bins(prev_isig, prev_res,
                                                   outer_isig, outer_res)
                bins.append(outer_res)

                #NOTE: get out of the loop, see the value of `skip` in
                #max's code
                break
            else:
                bins.append(outer_res)
            prev_res, prev_isig = outer_res, outer_isig

        # Now the implementation of what max does when he encouters
        # the total values, which are conveniently already parsed in
        # our case
        if len(bins) < 2:
            EDVerbose.DEBUG("No bins with I/sigma greater than %s" % isig_cutoff)
            EDVerbose.DEBUG("""something could be wrong, or the completeness could be too low!
bravais lattice/SG could be incorrect or something more insidious like
incorrect parameters in XDS.INP like distance, X beam, Y beam, etc.
Stopping""")
            self.setFailure()
            return
        if res_override is not None:
            res = res_override.value
        # remove last bin (see why w/ max)
        retbins = [XSDataFloat(x) for x in bins[:-1]]


        data_output = XSDataResCutoffResult()
        data_output.res = XSDataFloat(res)
        data_output.bins = retbins
        totals = self.dataInput.total_completeness
        data_output.total_complete = totals.outer_complete
        data_output.total_rfactor = totals.outer_rfactor
        data_output.total_isig = totals.outer_isig

        self.dataOutput = data_output
开发者ID:gbourgh,项目名称:edna,代码行数:80,代码来源:EDPluginResCutoff.py

示例6: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
 def process(self, _edObject=None):
     EDPlugin.process(self, _edObject)
     EDVerbose.DEBUG("EDPluginWrapperForJobScheduler.process")
     #print "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     EDVerbose.DEBUG("Executing: oarsub \"python %s\"" % self.__strPathToPythonWrapper)
     os.system("oarsub -l \"{cpu_vendor='INTEL'}/core=1\" \"python %s\"" % self.__strPathToPythonWrapper)
开发者ID:gbourgh,项目名称:edna,代码行数:8,代码来源:EDPluginWrapperForJobScheduler.py

示例7: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
 def process(self, _edObject=None):
     EDPlugin.process(self, _edObject)
     EDVerbose.DEBUG("EDPluginWrapperForJobScheduler.process")
     # print "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
     EDVerbose.DEBUG('Executing: oarsub "python %s"' % self.__strPathToPythonWrapper)
     os.system('oarsub -l "{cpu_vendor=\'INTEL\'}/core=1" "python %s"' % self.__strPathToPythonWrapper)
开发者ID:edna-site,项目名称:edna,代码行数:8,代码来源:EDPluginWrapperForJobScheduler.py

示例8: process

# 需要导入模块: from EDPlugin import EDPlugin [as 别名]
# 或者: from EDPlugin.EDPlugin import process [as 别名]
    def process(self, _edObject=None):
        EDPlugin.process(self)
        detector_max_res = self.dataInput.detector_max_res
        if detector_max_res is not None:
            detector_max_res = detector_max_res.value

        completeness_cutoff_param = self.dataInput.completeness_cutoff
        if completeness_cutoff_param is None:
            completeness_cutoff = 80
        else:
            completeness_cutoff = completeness_cutoff_param.value

        isig_cutoff_param = self.dataInput.isig_cutoff
        if isig_cutoff_param is None:
            isig_cutoff = 3
        else:
            isig_cutoff = isig_cutoff_param.value

        cc_half_cutoff_param = self.dataInput.cc_half_cutoff
        if cc_half_cutoff_param is not None:
            cc_half_cutoff = cc_half_cutoff_param.value
        else:
            cc_half_cutoff = 30

        res_override = self.dataInput.res_override

        bins = list()

        # for the first iteration
        # comment from max's code: "less stringent at low res"
        local_completeness_cutoff = 70
        # declared but not initialized in the perl code
        prev_isig = prev_res = 0

        # XXX: if res is still not defined at the end it is set to
        # detector_max_res, which we should somehow defined (in the
        # data model?) and used as the default value before we start
        # the processing
        res = detector_max_res

        for entry in self.dataInput.completeness_entries:
            current_res = entry.res.value
            complete = entry.complete.value
            rfactor = entry.rfactor.value
            isig = entry.isig.value
            cc_half = entry.half_dataset_correlation.value

            # isig < isig_cutoff or \
            if cc_half < cc_half_cutoff or \
               (res_override is not None and current_res < res_override.value):
                continue
            else:
                bins.append(current_res)

        # Now the implementation of what max does when he encouters
        # the total values, which are conveniently already parsed in
        # our case
        if len(bins) < 2:
            strErrorMessage = "No bins with CC1/2 greater than %s" % cc_half_cutoff
            self.ERROR(strErrorMessage)
            self.addErrorMessage(strErrorMessage)
            self.ERROR("Something could be wrong, or the completeness could be too low!")
            self.ERROR("bravais lattice/SG could be incorrect or something more insidious like")
            self.ERROR("incorrect parameters in XDS.INP like distance, X beam, Y beam, etc.")
            self.ERROR("Stopping")
            self.setFailure()
            return
        if res is None:
            res = sorted(bins)[0]
        if res_override is not None:
            res = res_override.value

        retbins = [XSDataDouble(x) for x in bins]


        data_output = XSDataResCutoffResult()
        data_output.res = XSDataDouble(res)
        data_output.bins = retbins
        totals = self.dataInput.total_completeness
        data_output.total_complete = totals.complete
        data_output.total_rfactor = totals.rfactor
        data_output.total_isig = totals.isig

        self.dataOutput = data_output
开发者ID:jordiandreu,项目名称:edna-mx,代码行数:86,代码来源:EDPluginResCutoffv1_0.py


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