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


Python XSDataFile.path方法代码示例

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


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

示例1: process

# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import path [as 别名]
    def process(self, _edObject = None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginControlRunXds.process")
        # First run is vanilla without any modification
        params = XSDataMinimalXdsIn()
        params.input_file = self.dataInput.input_file
        self.first_run.dataInput = params
        self.first_run.executeSynchronous()

        EDVerbose.DEBUG('first run completed...')

        if self.first_run.dataOutput is not None and self.first_run.dataOutput.succeeded.value:
            EDVerbose.DEBUG('... and it worked')
            self.successful_run = self.first_run
        else:
            EDVerbose.DEBUG('... and it failed')


        if not self.successful_run:
            # second run w/ JOB set to DEFPIX INTEGRATE CORRECT
            self.second_run = self.loadPlugin(self.controlled_plugin_name)
            params = XSDataMinimalXdsIn()
            params.input_file = self.dataInput.input_file
            params.jobs = 'DEFPIX INTEGRATE CORRECT'
            self.second_run.dataInput = params
            self.second_run.executeSynchronous()

            EDVerbose.DEBUG('second run completed')
            if self.second_run.dataOutput is not None and self.second_run.dataOutput.succeeded.value:
                EDVerbose.DEBUG('... and it worked')
                self.successful_run = self.second_run
            else:
                EDVerbose.DEBUG('... and it failed')


        if not self.successful_run:
        # third run with JOB set to ALL and mxaprocs = 4 and maxjobs = 1
            self.third_run = self.loadPlugin(self.controlled_plugin_name)
            params = XSDataMinimalXdsIn()
            params.input_file = self.dataInput.input_file
            params.jobs = 'ALL'
            params.maxprocs = 4
            params.maxjobs = 1
            self.third_run.dataInput = params
            self.third_run.executeSynchronous()

            EDVerbose.DEBUG('third run completed')
            if self.third_run.dataOutput is not None and self.third_run.dataOutput.succeeded.value:
                EDVerbose.DEBUG('... and it worked')
                self.successful_run = self.third_run
            else:
                EDVerbose.DEBUG('... and it failed')


        if not self.successful_run:
        # final run with parallelism like 3 but JOB like 2
            self.final_run = self.loadPlugin(self.controlled_plugin_name)
            params = XSDataMinimalXdsIn()
            params.input_file = self.dataInput.input_file
            params.jobs = 'DEFPIX INTEGRATE CORRECT'
            params.maxprocs = 4
            params.maxjobs = 1
            self.final_run.dataInput = params
            self.final_run.executeSynchronous()

            EDVerbose.DEBUG('final run completed')
            if self.final_run.dataOutput is not None and self.final_run.dataOutput.succeeded:
                EDVerbose.DEBUG('... and it worked')
                self.successful_run = self.final_run
            else:
                EDVerbose.DEBUG('... and it failed')

        if not self.successful_run:
        # all runs failed so bail out ...
            self.setFailure()
        else:
            # use the xds parser plugin to parse the xds output file...
            parser = self.loadPlugin("EDPluginParseXdsOutput")
            wd = self.successful_run.getWorkingDirectory()
            parser_input = XSDataXdsOutputFile()
            correct_lp_path = XSDataFile()
            correct_lp_path.path = XSDataString(os.path.join(wd, 'CORRECT.LP'))
            parser_input.correct_lp = correct_lp_path
            gxparm_path = os.path.join(wd, 'GXPARM.XDS')
            if os.path.isfile(gxparm_path):
                gxparm = XSDataFile()
                gxparm.path = XSDataString(os.path.join(wd, 'GXPARM.XDS'))
                parser_input.gxparm = gxparm

            parser.dataInput = parser_input
            parser.executeSynchronous()

            if parser.isFailure():
                # that should not happen
                self.setFailure()
                return
            self.dataOutput = parser.dataOutput
开发者ID:edna-site,项目名称:edna,代码行数:99,代码来源:EDPluginControlRunXds.py

示例2: process

# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import path [as 别名]

#.........这里部分代码省略.........
            if self.end_image_no <= 300:
                # All data as spot range
                xsDataRangeLimited = XSDataRange()
                xsDataRangeLimited.begin = 1
                xsDataRangeLimited.end = self.end_image_no
                params.addSpot_range(xsDataRangeLimited)
            else:
                # Start spot range
                xsDataRangeLimited = XSDataRange()
                xsDataRangeLimited.begin = 1
                xsDataRangeLimited.end = 100
                params.addSpot_range(xsDataRangeLimited)
                # Start spot range
                middleImageNumber = int(self.end_image_no / 2)
                xsDataRangeLimited = XSDataRange()
                xsDataRangeLimited.begin = middleImageNumber - 49
                xsDataRangeLimited.end = middleImageNumber + 50
                params.addSpot_range(xsDataRangeLimited)
                # End spot range
                xsDataRangeLimited = XSDataRange()
                xsDataRangeLimited.begin = self.end_image_no - 99
                xsDataRangeLimited.end = self.end_image_no
                params.addSpot_range(xsDataRangeLimited)


            self.second_run.dataInput = params
            self.second_run.executeSynchronous()
            self.retrieveFailureMessages(self.second_run, "Second XDS run")

            EDVerbose.DEBUG('second run completed')
            if self.second_run.dataOutput is not None and self.second_run.dataOutput.succeeded.value:
                EDVerbose.DEBUG('... and it worked')
                self.successful_run = self.second_run
            else:
                EDVerbose.DEBUG('... and it failed')

        if not self.successful_run:
            self.third_run = self.loadPlugin(self.controlled_plugin_name)
            self.screen('Retrying with reduced SPOT_RANGE')
            self.DEBUG('copying previously generated files to the new plugin dir')
            copy_xds_files(self.first_run.getWorkingDirectory(),
                           self.third_run.getWorkingDirectory())
            params = XSDataMinimalXdsIn()
            params.input_file = self.dataInput.input_file
            # params.job = XSDataString('DEFPIX INTEGRATE CORRECT')
            params.spacegroup = self.dataInput.spacegroup
            params.unit_cell = self.dataInput.unit_cell

            # Limited spot range: 1 to 20 or max no data points

            xsDataRangeLimited = XSDataRange()
            xsDataRangeLimited.begin = 1
            xsDataRangeLimited.end = 20 if self.end_image_no > 20 else self.end_image_no

            params.addSpot_range(xsDataRangeLimited)

            self.third_run.dataInput = params
            self.third_run.executeSynchronous()
            self.retrieveFailureMessages(self.third_run, "Second XDS run")

            EDVerbose.DEBUG('second run completed')
            if self.third_run.dataOutput is not None and self.third_run.dataOutput.succeeded.value:
                EDVerbose.DEBUG('... and it worked')
                self.successful_run = self.third_run
            else:
                EDVerbose.DEBUG('... and it failed')



        if not self.successful_run:
        # all runs failed so bail out ...
            strErrorMessage = "All three XDS runs failed"
            self.addErrorMessage(strErrorMessage)
            self.ERROR(strErrorMessage)
            self.setFailure()
        else:
            # use the xds parser plugin to parse the xds output file...
            parser = self.loadPlugin("EDPluginParseXdsOutputv1_0")
            wd = self.successful_run.getWorkingDirectory()
            parser_input = XSDataXdsOutputFile()
            correct_lp_path = XSDataFile()
            correct_lp_path.path = XSDataString(os.path.join(wd, 'CORRECT.LP'))
            parser_input.correct_lp = correct_lp_path
            gxparm_path = os.path.join(wd, 'GXPARM.XDS')
            if os.path.isfile(gxparm_path):
                gxparm = XSDataFile()
                gxparm.path = XSDataString(os.path.join(wd, 'GXPARM.XDS'))
                parser_input.gxparm = gxparm

            parser.dataInput = parser_input
            parser.executeSynchronous()

            if parser.isFailure():
                # that should not happen
                strErrorMessage = "Parser failure in XDS fast proc"
                self.ERROR(strErrorMessage)
                self.addErrorMessage(strErrorMessage)
                self.setFailure()
                return
            self.dataOutput = parser.dataOutput
开发者ID:jordiandreu,项目名称:edna-mx,代码行数:104,代码来源:EDPluginControlRunXdsFastProcv1_0.py

示例3: process

# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import path [as 别名]

#.........这里部分代码省略.........

        if not self.successful_run:
            self.second_run = self.loadPlugin(self.controlled_plugin_name)
            self.DEBUG('retrying with increased SPOT_RANGE')
            self.DEBUG('copying previously generated files to the new plugin dir')
            copy_xds_files(self.first_run.getWorkingDirectory(),
                           self.second_run.getWorkingDirectory())
            params = XSDataMinimalXdsIn()
            params.input_file = self.dataInput.input_file
            params.job = XSDataString('DEFPIX INTEGRATE CORRECT')
            params.spacegroup = self.dataInput.spacegroup
            params.unit_cell = self.dataInput.unit_cell

            # increase all the spot ranges end by 20, constrained to
            # the data range upper limit
            spot_range = list()
            for srange in self.spot_range:
                range_begin = srange[0]
                range_end = srange[1] + 20
                if range_end > self.end_image_no:
                    self.DEBUG('End of range {0} would be past the last image {1}'.format(range_end,
                                                                                          self.end_image_no))
                    range_end = self.end_image_no
                self.DEBUG('Changing spot range {0} to [{1} {2}]'.format(srange, range_begin, range_end))
                r = XSDataRange(begin=range_begin, end=range_end)
                spot_range.append(r)

            params.spot_range = spot_range

            self.second_run.dataInput = params
            self.second_run.executeSynchronous()

            EDVerbose.DEBUG('second run completed')
            if self.second_run.dataOutput is not None and self.second_run.dataOutput.succeeded.value:
                EDVerbose.DEBUG('... and it worked')
                self.successful_run = self.second_run
            else:
                EDVerbose.DEBUG('... and it failed')


        if not self.successful_run:
            self.third_run = self.loadPlugin(self.controlled_plugin_name)
            self.DEBUG('retrying with increased SPOT_RANGE')
            self.DEBUG('copying previously generated files to the new plugin dir')
            copy_xds_files(self.second_run.getWorkingDirectory(),
                           self.third_run.getWorkingDirectory())
            params = XSDataMinimalXdsIn()
            params.input_file = self.dataInput.input_file
            params.job = XSDataString('DEFPIX INTEGRATE CORRECT')
            params.spacegroup = self.dataInput.spacegroup
            params.unit_cell = self.dataInput.unit_cell
            spot_range = list()
            for srange in self.spot_range:
                range_begin = srange[0]
                range_end = srange[1] + 40
                if range_end > self.end_image_no:
                    self.DEBUG('End of range {0} would be past the last image {1}'.format(range_end,
                                                                                          self.end_image_no))
                    range_end = self.end_image_no
                self.DEBUG('Changing spot range {0} to [{1} {2}]'.format(srange, range_begin, range_end))
                r = XSDataRange(begin=range_begin, end=range_end)
                spot_range.append(r)

            params.spot_range = spot_range

            self.third_run.dataInput = params
            self.third_run.executeSynchronous()

            EDVerbose.DEBUG('third run completed')
            if self.third_run.dataOutput is not None and self.third_run.dataOutput.succeeded.value:
                EDVerbose.DEBUG('... and it worked')
                self.successful_run = self.third_run
            else:
                EDVerbose.DEBUG('... and it failed')

        if not self.successful_run:
        # all runs failed so bail out ...
            self.setFailure()
        else:
            # use the xds parser plugin to parse the xds output file...
            parser = self.loadPlugin("EDPluginParseXdsOutput")
            wd = self.successful_run.getWorkingDirectory()
            parser_input = XSDataXdsOutputFile()
            correct_lp_path = XSDataFile()
            correct_lp_path.path = XSDataString(os.path.join(wd, 'CORRECT.LP'))
            parser_input.correct_lp = correct_lp_path
            gxparm_path = os.path.join(wd, 'GXPARM.XDS')
            if os.path.isfile(gxparm_path):
                gxparm = XSDataFile()
                gxparm.path = XSDataString(os.path.join(wd, 'GXPARM.XDS'))
                parser_input.gxparm = gxparm

            parser.dataInput = parser_input
            parser.executeSynchronous()

            if parser.isFailure():
                # that should not happen
                self.setFailure()
                return
            self.dataOutput = parser.dataOutput
开发者ID:edna-site,项目名称:edna,代码行数:104,代码来源:EDPluginControlRunXdsFastProc.py

示例4: log_to_ispyb

# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import path [as 别名]
            EDVerbose.screen('generating w/ and w/out anom finished')
            log_to_ispyb([self.integration_id_anom, self.integration_id_noanom],
                         'Scaling',
                         'Successful',
                         'anom/noanom generation finished in {0}s'.format(self.stats['anom/noanom_generation']))

        # we can now use the xds output parser on the two correct.lp
        # files, w/ and w/out anom
        parse_anom_input = XSDataXdsOutputFile()
        parse_anom_input.correct_lp = XSDataFile()
        parse_anom_input.correct_lp.path = self.generate.dataOutput.correct_lp_anom

        # this one is the same as the first XDS run since they share
        # the same directory
        gxparm_file_anom = XSDataFile()
        gxparm_file_anom.path = self.generate.dataOutput.gxparm
        parse_anom_input.gxparm = gxparm_file_anom

        self.parse_xds_anom.dataInput = parse_anom_input

        self.parse_xds_anom.executeSynchronous()

        if self.parse_xds_anom.isFailure():
            EDVerbose.ERROR('parsing the xds generated w/ anom failed')
            self.setFailure()
            return

        # now the other one w/out anom
        parse_noanom_input = XSDataXdsOutputFile()
        parse_noanom_input.correct_lp = XSDataFile()
        parse_noanom_input.correct_lp.path = self.generate.dataOutput.correct_lp_no_anom
开发者ID:edna-site,项目名称:edna,代码行数:33,代码来源:EDPluginControlAutoproc.py


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