def launch_plotXml(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")

            for i in range(0, len(output)):
                valide = validation.data_plot(str(self.vname),
                                              self.params, output[i],
                                              str(xmlname), params_val,
                                              depend_val.keys()[0], 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
Esempio n. 2
0
	def launch_plotXml(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")

			for i in range(0,len(output)):
				valide=validation.data_plot(str(self.vname),
												self.params,
												output[i],
												str(xmlname),
												params_val,
												depend_val.keys()[0],
												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_plot(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 wrong"
                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")

            for i in range(0, len(output)):
                valide = validation.data_plot(
                    str(self.vname), self.params, output[i],
                    str(self.base_dir + "xml/xml_result.xml"), params_val,
                    depend_val.keys()[0], 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, []
Esempio n. 4
0
	def launch_plot(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 wrong"
				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")

			for i in range(0,len(output)):
				valide=validation.data_plot(str(self.vname),
												self.params,
												output[i],
												str(self.base_dir+"xml/xml_result.xml"),
												params_val,
												depend_val.keys()[0],
												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,[]