def testSetDataModelInput(self): edPluginBest = self.createPlugin() edConfigurationGood01 = EDConfiguration(os.path.join(self.strDataPath, "XSConfiguration.xml")) dictItemGood01 = edConfigurationGood01.get(self.getPluginName()) edPluginBest.setConfig(dictItemGood01, _bLocal = True) edPluginBest.setScriptExecutable("cat") edPluginBest.configure() from XSDataBestv1_3 import XSDataInputBest xsDataInputBest = XSDataInputBest() from XSDataCommon import XSDataAbsorbedDoseRate from XSDataCommon import XSDataDouble from XSDataCommon import XSDataString from XSDataCommon import XSDataTime from XSDataCommon import XSDataFile from XSDataCommon import XSDataAngularSpeed from XSDataCommon import XSDataString from XSDataCommon import XSDataAngle from XSDataCommon import XSDataBoolean xsDataInputBest.setCrystalAbsorbedDoseRate(XSDataAbsorbedDoseRate(0.22E+06)) xsDataInputBest.setCrystalShape(XSDataDouble(1)) xsDataInputBest.setCrystalSusceptibility(XSDataDouble(1.5)) xsDataInputBest.setDetectorType(XSDataString("q210-2x")) xsDataInputBest.setBeamExposureTime(XSDataTime(1)) xsDataInputBest.setBeamMaxExposureTime(XSDataTime(10000)) xsDataInputBest.setBeamMinExposureTime(XSDataTime(0.1)) xsDataInputBest.setGoniostatMinRotationWidth(XSDataAngle(0.1)) xsDataInputBest.setGoniostatMaxRotationSpeed(XSDataAngularSpeed(10)) xsDataInputBest.setAimedResolution(XSDataDouble(2)) xsDataInputBest.setAimedRedundancy(XSDataDouble(6.5)) xsDataInputBest.setAimedCompleteness(XSDataDouble(0.9)) xsDataInputBest.setAimedIOverSigma(XSDataDouble(3)) xsDataInputBest.setComplexity(XSDataString("min")) xsDataInputBest.setAnomalousData(XSDataBoolean(False)) fileDirectory = edPluginBest.getWorkingDirectory() bestFileContentDat = EDUtilsFile.readFile(os.path.join(self.strDataPath, "bestfile.dat")) xsDataInputBest.setBestFileContentDat(XSDataString(bestFileContentDat)) bestFileContentPar = EDUtilsFile.readFile(os.path.join(self.strDataPath, "bestfile.par")) xsDataInputBest.setBestFileContentPar(XSDataString(bestFileContentPar)) bestFileContentHKL = EDUtilsFile.readFile(os.path.join(self.strDataPath, "bestfile1.hkl")) xsDataInputBest.addBestFileContentHKL(XSDataString(bestFileContentHKL)) xsDataInputBest.exportToFile(self.obtainedInputFile) pyStrExpectedInput = self.readAndParseFile (self.referenceInputFile) pyStrObtainedInput = self.readAndParseFile (self.obtainedInputFile) xsDataInputExpected = XSDataInputBest.parseString(pyStrExpectedInput) xsDataInputObtained = XSDataInputBest.parseString(pyStrObtainedInput) EDAssert.equal(xsDataInputExpected.marshal(), xsDataInputObtained.marshal()) EDUtilsFile.deleteFile(self.obtainedInputFile) self.cleanUp(edPluginBest)
def testGenerateExecutiveSummary(self): pyStrInputBest = self.readAndParseFile(self.referenceInputFile) pyStrResultBest = self.readAndParseFile(self.referenceResultFile) from XSDataBestv1_3 import XSDataInputBest from XSDataBestv1_3 import XSDataResultBest xsDataInputBest = XSDataInputBest.parseString(pyStrInputBest) xsDataResultBest = XSDataResultBest.parseString(pyStrResultBest) edPluginBest = self.createPlugin() edPluginBest.setDataInput(xsDataInputBest) edPluginBest.setDataOutput(xsDataResultBest) edPluginBest.generateExecutiveSummary(edPluginBest)
def testGenerateExecutiveSummary(self): pyStrInputBest = self.readAndParseFile (self.referenceInputFile) pyStrResultBest = self.readAndParseFile (self.referenceResultFile) from XSDataBestv1_3 import XSDataInputBest from XSDataBestv1_3 import XSDataResultBest xsDataInputBest = XSDataInputBest.parseString(pyStrInputBest) xsDataResultBest = XSDataResultBest.parseString(pyStrResultBest) edPluginBest = self.createPlugin() edPluginBest.setDataInput(xsDataInputBest) edPluginBest.setDataOutput(xsDataResultBest) edPluginBest.generateExecutiveSummary(edPluginBest)
def testSetDataModelInput(self): edPluginBest = self.createPlugin() edConfigurationGood01 = EDConfiguration( os.path.join(self.strDataPath, "XSConfiguration.xml")) dictItemGood01 = edConfigurationGood01.get(self.getPluginName()) edPluginBest.setConfig(dictItemGood01, _bLocal=True) edPluginBest.setScriptExecutable("cat") edPluginBest.configure() from XSDataBestv1_3 import XSDataInputBest xsDataInputBest = XSDataInputBest() from XSDataCommon import XSDataAbsorbedDoseRate from XSDataCommon import XSDataDouble from XSDataCommon import XSDataString from XSDataCommon import XSDataTime from XSDataCommon import XSDataFile from XSDataCommon import XSDataAngularSpeed from XSDataCommon import XSDataString from XSDataCommon import XSDataAngle from XSDataCommon import XSDataBoolean xsDataInputBest.setCrystalAbsorbedDoseRate( XSDataAbsorbedDoseRate(0.22E+06)) xsDataInputBest.setCrystalShape(XSDataDouble(1)) xsDataInputBest.setCrystalSusceptibility(XSDataDouble(1.5)) xsDataInputBest.setDetectorType(XSDataString("q210-2x")) xsDataInputBest.setBeamExposureTime(XSDataTime(1)) xsDataInputBest.setBeamMaxExposureTime(XSDataTime(10000)) xsDataInputBest.setBeamMinExposureTime(XSDataTime(0.1)) xsDataInputBest.setGoniostatMinRotationWidth(XSDataAngle(0.1)) xsDataInputBest.setGoniostatMaxRotationSpeed(XSDataAngularSpeed(10)) xsDataInputBest.setAimedResolution(XSDataDouble(2)) xsDataInputBest.setAimedRedundancy(XSDataDouble(6.5)) xsDataInputBest.setAimedCompleteness(XSDataDouble(0.9)) xsDataInputBest.setAimedIOverSigma(XSDataDouble(3)) xsDataInputBest.setComplexity(XSDataString("min")) xsDataInputBest.setAnomalousData(XSDataBoolean(False)) fileDirectory = edPluginBest.getWorkingDirectory() bestFileContentDat = EDUtilsFile.readFile( os.path.join(self.strDataPath, "bestfile.dat")) xsDataInputBest.setBestFileContentDat(XSDataString(bestFileContentDat)) bestFileContentPar = EDUtilsFile.readFile( os.path.join(self.strDataPath, "bestfile.par")) xsDataInputBest.setBestFileContentPar(XSDataString(bestFileContentPar)) bestFileContentHKL = EDUtilsFile.readFile( os.path.join(self.strDataPath, "bestfile1.hkl")) xsDataInputBest.addBestFileContentHKL(XSDataString(bestFileContentHKL)) xsDataInputBest.exportToFile(self.obtainedInputFile) pyStrExpectedInput = self.readAndParseFile(self.referenceInputFile) pyStrObtainedInput = self.readAndParseFile(self.obtainedInputFile) xsDataInputExpected = XSDataInputBest.parseString(pyStrExpectedInput) xsDataInputObtained = XSDataInputBest.parseString(pyStrObtainedInput) EDAssert.equal(xsDataInputExpected.marshal(), xsDataInputObtained.marshal()) EDUtilsFile.deleteFile(self.obtainedInputFile) self.cleanUp(edPluginBest)