Ejemplo n.º 1
0
    def testExecute(self):
        """
        """
        self.run()
        plugin = self.getPlugin()

        # Checking obtained results
        xsDataResult = plugin.getDataOutput()
        xsDataRef = XSDataResult1DPowderEDF.parseString(
            self.readAndParseFile(self.getReferenceDataOutputFile()))
        #        EDAssert.strAlmostEqual(XSDataResult1DPowderEDF.parseString(self.readAndParseFile(self.getReferenceDataOutputFile())).marshal(), xsDataResult.marshal(), _strComment="XML structures are the same")
        tthref = EDUtilsArray.xsDataToArray(xsDataRef.getTwoTheta(),
                                            _bCheckMd5sum=False)
        tthobt = EDUtilsArray.xsDataToArray(xsDataResult.getTwoTheta(),
                                            _bCheckMd5sum=False)

        Iref = EDUtilsArray.xsDataToArray(xsDataRef.getIntensity(),
                                          _bCheckMd5sum=False)
        Iobt = EDUtilsArray.xsDataToArray(xsDataResult.getIntensity(),
                                          _bCheckMd5sum=False)

        EDAssert.arraySimilar(_npaValue=tthobt,
                              _npaRef=tthref,
                              _fAbsMaxDelta=0.1,
                              _strComment="2theta arrays are the same")
        EDAssert.arraySimilar(_npaValue=Iobt,
                              _npaRef=Iref,
                              _fAbsMaxDelta=0.1,
                              _strComment="Intensity arrays are the same")
    def testExecute(self):
        """
        """
        self.run()
        plugin = self.getPlugin()

        # Checking obtained results
        xsDataResult = plugin.getDataOutput()
        xsDataRef = XSDataResult1DPowderEDF.parseString(
            self.readAndParseFile(self.getReferenceDataOutputFile()))
        #        EDAssert.strAlmostEqual(XSDataResult1DPowderEDF.parseString(self.readAndParseFile(self.getReferenceDataOutputFile())).marshal(), xsDataResult.marshal(), _strComment="XML structures are the same")
        tthref = EDUtilsArray.xsDataToArray(
            xsDataRef.getTwoTheta(), _bCheckMd5sum=False)
        tthobt = EDUtilsArray.xsDataToArray(
            xsDataResult.getTwoTheta(), _bCheckMd5sum=False)

        Iref = EDUtilsArray.xsDataToArray(
            xsDataRef.getIntensity(), _bCheckMd5sum=False)
        Iobt = EDUtilsArray.xsDataToArray(
            xsDataResult.getIntensity(), _bCheckMd5sum=False)

        EDAssert.arraySimilar(
            _npaValue=tthobt,
            _npaRef=tthref,
            _fAbsMaxDelta=0.1,
            _strComment="2theta arrays are the same")
        EDAssert.arraySimilar(
            _npaValue=Iobt,
            _npaRef=Iref,
            _fAbsMaxDelta=0.1,
            _strComment="Intensity arrays are the same")
    def testExecute(self):
        """
        """
        self.run()
        plugin = self.getPlugin()

        # Checking obtained results
        xsDataResult = plugin.getDataOutput()
        EDAssert.strAlmostEqual(XSDataResult1DPowderEDF.parseString(self.readAndParseFile(self.getReferenceDataOutputFile())).marshal(), xsDataResult.marshal(), _strComment="XML structures are the same")

        outputData = open(xsDataResult.getOutputFile().getPath().getValue(), "rb").read()
        referenceData = open(os.path.join(self.getTestsDataImagesHome(), self.refOutput), "rb").read()

        EDAssert.strAlmostEqual(referenceData, outputData, "ChiPlot files are the same")
Ejemplo n.º 4
0
 def postProcess(self, _edObject=None):
     EDPluginExec.postProcess(self)
     EDVerbose.DEBUG("EDPluginExportAsciiPowderv1_0.postProcess")
     # Create some output data
     xsDataResult = XSDataResult1DPowderEDF()
     if self.outputFilename is None:
         xsDataResult.setTwoTheta(EDUtilsArray.arrayToXSData(self.npaTwoTheta))
         xsDataResult.setIntensity(EDUtilsArray.arrayToXSData(self.npaIntensities))
     else:
         xsdFile = XSDataFile()
         xsdFile.setPath(XSDataString(self.outputFilename))
         xsDataResult.setOutputFile(xsdFile)
     self.setDataOutput(xsDataResult)
     self.npaTwoTheta = None
     self.npaIntensities = None
     self.inputArray = None
    def testExecute(self):
        """
        """
        self.run()
        plugin = self.getPlugin()

        # Checking obtained results
        xsDataResult = plugin.getDataOutput()
        EDAssert.strAlmostEqual(XSDataResult1DPowderEDF.parseString(
            self.readAndParseFile(
                self.getReferenceDataOutputFile())).marshal(),
                                xsDataResult.marshal(),
                                _strComment="XML structures are the same")

        outputData = open(xsDataResult.getOutputFile().getPath().getValue(),
                          "rb").read()
        referenceData = open(
            os.path.join(self.getTestsDataImagesHome(), self.refOutput),
            "rb").read()

        EDAssert.strAlmostEqual(referenceData, outputData,
                                "SpreadSheet files are the same")