def launchXml(self, params_val, depend_val, output, precision, mode,
                  xmlname):
        for i in range(0, len(depend_val)):
            graph_dir = self.base_dir + "graph/" + self.name + "/"
            for k in range(0, len(self.params)):
                if not (self.params[k].getName() == depend_val.keys()[i]):
                    graph_dir += self.params[k].getName() + "_" + params_val[
                        self.params[k].getName()][0] + "/"

            try:
                os.makedirs(str(graph_dir))
            except OSError:
                pass

            pdf = str(graph_dir)
            pdfname = []
            for tmpOut in output:
                pdfname.append(pdf + tmpOut.getName() + ".pdf")

            valide = validation.validation_code(str(self.vname),
                                                self.params, output,
                                                str(xmlname), params_val,
                                                depend_val, precision, pdf)
            index = 0
            for tmpPdf in pdfname:
                os.system("convert -density 150 " + tmpPdf + " " + tmpPdf +
                          ".png")
                pdfname[index] = pdfname[index] + ".png"
                index += 1

        return valide, pdfname
Пример #2
0
	def launchXml(self,params_val,depend_val,output,precision,mode,xmlname):
		for i in range(0,len(depend_val)):
			graph_dir=self.base_dir+"graph/"+self.name+"/"
			for k in range(0,len(self.params)):
				if not (self.params[k].getName() == depend_val.keys()[i]):
					graph_dir+=self.params[k].getName()+"_"+params_val[self.params[k].getName()][0]+"/"

			try:
				os.makedirs(str(graph_dir))
			except OSError:
				pass

			pdf=str(graph_dir)
			pdfname=[]
			for tmpOut in output:
				pdfname.append(pdf+tmpOut.getName()+".pdf")

			valide=validation.validation_code(str(self.vname),
											self.params,
											output,
											str(xmlname),
											params_val,
											depend_val,
											precision,
											pdf)
			index=0
			for tmpPdf in pdfname:
				os.system("convert -density 150 "+tmpPdf+" "+tmpPdf+".png")
				pdfname[index]=pdfname[index]+".png"
				index+=1

		return valide,pdfname
    def launch(self, params_val, depend_val, output, precision, mode):
        if (mode == 1):
            if not self.verify(params_val, depend_val, output):
                print "[CodeCalcul] error : Some values are out of range"
                return
        for i in range(0, len(depend_val)):
            for j in range(0, len(depend_val[depend_val.keys()[i]])):
                lString = " " + self.other_options
                img_dir = self.base_dir + self.vname + "/"
                for k in range(0, len(self.params)):
                    if self.params[k].getName() == depend_val.keys()[i]:
                        img_dir += self.params[k].getName() + "_" + depend_val[
                            self.params[k].getName()][j] + "/"
                        lString += " --" + self.params[k].getCmdName(
                        ) + "=" + depend_val[self.params[k].getName()][j]
                    else:
                        img_dir += self.params[k].getName() + "_" + params_val[
                            self.params[k].getName()][0] + "/"
                        lString += " --" + self.params[k].getCmdName(
                        ) + "=" + params_val[self.params[k].getName()][0]
                print str(self.exec_path + self.name + lString)
                if not os.system(
                        str(self.exec_path + self.name + lString)) == 0:
                    raise IOError, "error in execution"

            graph_dir = self.base_dir + "graph/" + self.name + "/"
            for k in range(0, len(self.params)):
                if not (self.params[k].getName() == depend_val.keys()[i]):
                    graph_dir += self.params[k].getName() + "_" + params_val[
                        self.params[k].getName()][0] + "/"

            try:
                os.makedirs(str(graph_dir))
            except OSError:
                pass

            pdf = str(graph_dir)
            pdfname = []
            for tmpOut in output:
                pdfname.append(pdf + tmpOut.getName() + ".pdf")

            valide = validation.validation_code(
                str(self.vname), self.params, output,
                str(self.base_dir + "xml/xml_result.xml"), params_val,
                depend_val, precision, pdf)
            index = 0
            for tmpPdf in pdfname:
                os.system("convert -density 150 " + tmpPdf + " " + tmpPdf +
                          ".png")
                pdfname[index] = pdfname[index] + ".png"
                index += 1

        return valide, pdfname, []
Пример #4
0
	def launch(self,params_val,depend_val,output,precision,mode):
		if (mode==1):
			if not self.verify(params_val,depend_val,output):
				print "[CodeCalcul] error : Some values are out of range"
				return
		for i in range(0,len(depend_val)):
			for j in range(0,len(depend_val[depend_val.keys()[i]])):
				lString=" "+self.other_options
				img_dir=self.base_dir+self.vname+"/"
				for k in range(0,len(self.params)):
					if self.params[k].getName() == depend_val.keys()[i]:
						img_dir+=self.params[k].getName()+"_"+depend_val[self.params[k].getName()][j]+"/"
						lString+=" --"+self.params[k].getCmdName()+"="+depend_val[self.params[k].getName()][j]
					else:
						img_dir+=self.params[k].getName()+"_"+params_val[self.params[k].getName()][0]+"/"
						lString+=" --"+self.params[k].getCmdName()+"="+params_val[self.params[k].getName()][0]
				print str(self.exec_path+self.name+lString)
				if not os.system(str(self.exec_path+self.name+lString))==0:
					raise IOError, "error in execution"

			graph_dir=self.base_dir+"graph/"+self.name+"/"
			for k in range(0,len(self.params)):
				if not (self.params[k].getName() == depend_val.keys()[i]):
					graph_dir+=self.params[k].getName()+"_"+params_val[self.params[k].getName()][0]+"/"

			try:
				os.makedirs(str(graph_dir))
			except OSError:
				pass

			pdf=str(graph_dir)
			pdfname=[]
			for tmpOut in output:
				pdfname.append(pdf+tmpOut.getName()+".pdf")

			valide=validation.validation_code(str(self.vname),
											self.params,
											output,
											str(self.base_dir+"xml/xml_result.xml"),
											params_val,
											depend_val,
											precision,
											pdf)
			index=0
			for tmpPdf in pdfname:
				os.system("convert -density 150 "+tmpPdf+" "+tmpPdf+".png")
				pdfname[index]=pdfname[index]+".png"
				index+=1

		return valide,pdfname,[]
Пример #5
0
import validation
import error
import displayGraphics
from pyx import color,text,unit,canvas

from numpy import log

################################################################################
#				Main program
################################################################################




reponse = xmlParser.parse_xml_response("essai_xml_response.xml")
print(validation.validation_code(reponse,"essai_xml.xml","laplacian1DP1",0.32))
#print(validation.validation_code_norm(reponse,"essai_xml.xml","laplacian1DP1","H1",0.05))
data=[[1,2,20],[1,4,6.78]]
func="x**2"
#print(error.validation_all(data,func,0.1))

#data=datas[0]
#func=funcs[0]
data2=error.changedata(data,func)
func2=error.changefunc(func)
data3=error.slope_calc(data,func)

#print(data2)
#print(func2)

##V2 affichage en utilisant nos fonctions
Пример #6
0
import xmlParser
import validation
import error
import displayGraphics
from pyx import color, text, unit, canvas

from numpy import log

################################################################################
#				Main program
################################################################################

reponse = xmlParser.parse_xml_response("essai_xml_response.xml")
print(
    validation.validation_code(reponse, "essai_xml.xml", "laplacian1DP1",
                               0.32))
#print(validation.validation_code_norm(reponse,"essai_xml.xml","laplacian1DP1","H1",0.05))
data = [[1, 2, 20], [1, 4, 6.78]]
func = "x**2"
#print(error.validation_all(data,func,0.1))

#data=datas[0]
#func=funcs[0]
data2 = error.changedata(data, func)
func2 = error.changefunc(func)
data3 = error.slope_calc(data, func)

#print(data2)
#print(func2)

##V2 affichage en utilisant nos fonctions