diff -urN eficas-1.15.0.orig/Aster/Cata/cataSTA7/cata.py eficas-1.15.0/Aster/Cata/cataSTA7/cata.py --- eficas-1.15.0.orig/Aster/Cata/cataSTA7/cata.py 2008-12-08 14:54:05.000000000 +0100 +++ eficas-1.15.0/Aster/Cata/cataSTA7/cata.py 2009-01-13 14:18:25.000000000 +0100 @@ -34,7 +34,7 @@ pass # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: cata.py,v 1.4.14.1 2008-11-13 10:35:10 cchris Exp $" # JdC = JDC_CATA(code='ASTER', diff -urN eficas-1.15.0.orig/Aster/Cata/cataSTA8/cata.py eficas-1.15.0/Aster/Cata/cataSTA8/cata.py --- eficas-1.15.0.orig/Aster/Cata/cataSTA8/cata.py 2008-12-08 14:54:06.000000000 +0100 +++ eficas-1.15.0/Aster/Cata/cataSTA8/cata.py 2009-01-13 14:18:45.000000000 +0100 @@ -34,7 +34,7 @@ except: pass -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: cata.py,v 1.5.4.3 2008-12-08 13:50:34 pnoyret Exp $" EnumTypes = (ListType, TupleType) diff -urN eficas-1.15.0.orig/Aster/Cata/cataSTA9/cata.py eficas-1.15.0/Aster/Cata/cataSTA9/cata.py --- eficas-1.15.0.orig/Aster/Cata/cataSTA9/cata.py 2008-12-08 14:54:06.000000000 +0100 +++ eficas-1.15.0/Aster/Cata/cataSTA9/cata.py 2009-01-13 14:20:09.000000000 +0100 @@ -21,7 +21,7 @@ # faire que la division soit toujours réelle from __future__ import division -__version__ = "$Name: V1_15a2 $" +__version__ = "$Name: V1_15a4 $" __Id__ = "$Id: cata.py,v 1.3.4.2 2008-11-28 16:53:32 pnoyret Exp $" import Accas diff -urN eficas-1.15.0.orig/Aster/configuration.py eficas-1.15.0/Aster/configuration.py --- eficas-1.15.0.orig/Aster/configuration.py 2008-12-08 14:54:05.000000000 +0100 +++ eficas-1.15.0/Aster/configuration.py 2009-01-13 14:16:31.000000000 +0100 @@ -223,7 +223,7 @@ class CONFIG(CONFIGbase): - def __init__(self,appli,rep_ini): + def __init__(self,appli,repIni): self.dFichierEditeur={"ASTER" : "editeur.ini", "ASTER_SALOME" : "editeur_salome.ini"} @@ -237,8 +237,9 @@ if self.salome != 0 : clef = clef + "_SALOME" self.fichier=self.dFichierEditeur[clef] - self.rep_ini = rep_ini - self.fic_ini = os.path.join(self.rep_ini,self.fichier) + self.repIni = repIni + self.rep_ini = repIni + self.fic_ini = os.path.join(self.repIni,self.fichier) self.titre = "Paramètres nécessaires à la configuration d'EFICAS" self.texte_ini = "Voici les paramètres que requiert Eficas" self.commande = self.creation_fichier_ini_si_possible @@ -263,12 +264,12 @@ # Valeurs par defaut self.rep_user = utils.get_rep_user() self.initialdir=self.rep_user - self.savedir = self.initialdir + self.savedir = os.environ['HOME'] self.rep_travail=os.path.join(self.rep_user,'uaster','tmp_eficas') self.rep_mat="" self.path_doc=self.rep_user self.exec_acrobat=self.rep_user - self.catalogues= os.path.join(self.rep_ini,'..','Cata/cata.py') + self.catalogues= os.path.join(self.repIni,'..','Cata/cata.py') self.isdeveloppeur='NON' self.path_cata_dev=os.path.join(self.rep_user,'cata') CONFIGbase.__init__ (self,appli) @@ -280,7 +281,7 @@ # sauvegarde # les nouveaux paramètres dans le fichier de configuration utilisateur # - l_param=('exec_acrobat', 'rep_ini','catalogues','rep_travail','rep_mat','path_doc','savedir') + l_param=('exec_acrobat', 'repIni','catalogues','rep_travail','rep_mat','path_doc','savedir') texte="" for clef in l_param : if hasattr(self,clef): @@ -309,13 +310,14 @@ class CONFIGStyle(CONFIGbase): - def __init__(self,appli,rep_ini): + def __init__(self,appli,repIni): self.salome=appli.salome self.texte = "Pour prendre en compte les modifications \n"+\ " RELANCER EFICAS" self.fichier="style.py" - self.rep_ini = rep_ini - self.fic_ini = os.path.join(self.rep_ini,self.fichier) + self.repIni = repIni + self.rep_ini = repIni + self.fic_ini = os.path.join(self.repIni,self.fichier) self.titre = "Paramètres d affichage" self.texte_ini = "Voici les paramètres configurables : " self.commande = self.creation_fichier_ini_si_possible diff -urN eficas-1.15.0.orig/Aster/editeur.ini eficas-1.15.0/Aster/editeur.ini --- eficas-1.15.0.orig/Aster/editeur.ini 2008-12-16 14:14:06.000000000 +0100 +++ eficas-1.15.0/Aster/editeur.ini 2009-01-13 14:27:02.000000000 +0100 @@ -38,8 +38,8 @@ # Choix des catalogues catalogues = ( - ('ASTER','v7.8',os.path.join(rep_cata,'cataSTA7'),'python'), - ('ASTER','v8.8',os.path.join(rep_cata,'cataSTA8'),'python'), +# ('ASTER','v7.8',os.path.join(rep_cata,'cataSTA7'),'python'), +# ('ASTER','v8.8',os.path.join(rep_cata,'cataSTA8'),'python'), ('ASTER','v9.4',os.path.join(rep_cata,'cataSTA9'),'python','defaut'), ) diff -urN eficas-1.15.0.orig/Aster/editeur_salome.ini eficas-1.15.0/Aster/editeur_salome.ini --- eficas-1.15.0.orig/Aster/editeur_salome.ini 2008-12-16 14:14:00.000000000 +0100 +++ eficas-1.15.0/Aster/editeur_salome.ini 2009-01-13 14:26:57.000000000 +0100 @@ -38,8 +38,8 @@ # Choix des catalogues catalogues = ( - ('ASTER','v7.8',os.path.join(rep_cata,'cataSTA7'),'python'), - ('ASTER','v8.8',os.path.join(rep_cata,'cataSTA8'),'python'), +# ('ASTER','v7.8',os.path.join(rep_cata,'cataSTA7'),'python'), +# ('ASTER','v8.8',os.path.join(rep_cata,'cataSTA8'),'python'), ('ASTER','v9.4',os.path.join(rep_cata,'cataSTA9'),'python','defaut'), ) diff -urN eficas-1.15.0.orig/Editeur/analyse_catalogue.py eficas-1.15.0/Editeur/analyse_catalogue.py --- eficas-1.15.0.orig/Editeur/analyse_catalogue.py 2008-12-08 14:54:03.000000000 +0100 +++ eficas-1.15.0/Editeur/analyse_catalogue.py 2009-01-13 14:16:49.000000000 +0100 @@ -25,7 +25,7 @@ # __Id__="$Id: analyse_catalogue.py,v 1.7.4.1 2008-11-13 10:35:11 cchris Exp $" -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" # l_noms_commandes = ['OPER','PROC','MACRO','FORM'] l_noms_composes=['FACT','BLOC','NUPL','FORM'] diff -urN eficas-1.15.0.orig/InterfaceQT/monFonctionPanel.py eficas-1.15.0/InterfaceQT/monFonctionPanel.py --- eficas-1.15.0.orig/InterfaceQT/monFonctionPanel.py 2008-12-08 14:54:04.000000000 +0100 +++ eficas-1.15.0/InterfaceQT/monFonctionPanel.py 2009-01-12 15:59:04.000000000 +0100 @@ -52,8 +52,7 @@ l_valeurs=[] if (len(liste)% self.nbValeurs != 0): message="La cardinalité n'est pas correcte, la dernière valeur est ignorée" - #self.Commentaire.setText(QString(commentaire)) - self.editor.affiche_infos(commentaire) + self.editor.affiche_infos(message) for i in range(len(liste)/ self.nbValeurs) : if (self.nbValeurs==2): t=(liste[i*self.nbValeurs], liste[i*self.nbValeurs+1]) @@ -66,12 +65,22 @@ self.LBValeurs.clear() listeValeurs=self.node.item.GetListeValeurs() for valeur in self.DecoupeListeValeurs(listeValeurs): - self.LBValeurs.insertItem(str(valeur)) + if type(valeur) == types.TupleType: + TupleEnTexte="(" + for val in valeur : + TupleEnTexte = TupleEnTexte + str(self.politique.GetValeurTexte(val)) +", " + TupleEnTexte = TupleEnTexte[0:-2] +")" + self.LBValeurs.insertItem(TupleEnTexte) + else : + self.LBValeurs.insertItem(QString(str(valeur))) def Ajout1Valeur(self,liste=[]): # Pour être appele a partir du Panel Importer (donc plusieurs fois par AjouterNValeur) if liste == [] : - liste,validite=SaisieValeur.TraiteLEValeur(self) + liste,validite,texteBrut=SaisieValeur.TraiteLEValeur(self) + if validite : + for val in texteBrut.split(',') : + self.politique.AjoutDsDictReel(val) else : validite=1 if validite == 0 : return @@ -90,12 +99,12 @@ index=self.LBValeurs.currentItem() +1 indexListe=index*self.nbValeurs if index == 0 : - index = -1 + index = len(self.listeValeursCourantes) indexListe=len(self.listeValeursCourantes) listeVal=[] for valeur in self.listeValeursCourantes : listeVal.append(valeur) - validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(liste,index,listeVal) + validite,comm,comm2,listeRetour=self.politique.AjoutValeurs(liste,index+1,listeVal) self.Commentaire.setText(comm2) if not validite : self.editor.affiche_infos(comm) @@ -104,7 +113,14 @@ l1=self.listeValeursCourantes[:indexListe] l3=self.listeValeursCourantes[indexListe:] for valeur in self.DecoupeListeValeurs(listeRetour): - self.LBValeurs.insertItem(QString(str(valeur)),index) + if type(valeur) == types.TupleType: + TupleEnTexte="(" + for val in valeur : + TupleEnTexte = TupleEnTexte + str(self.politique.GetValeurTexte(val)) +", " + TupleEnTexte = TupleEnTexte[0:-2] +")" + self.LBValeurs.insertItem(TupleEnTexte,index) + else : + self.LBValeurs.insertItem(QString(str(valeur)),index) index=index+1 self.listeValeursCourantes=l1+listeRetour+l3 diff -urN eficas-1.15.0.orig/InterfaceQT/monPlusieursBasePanel.py eficas-1.15.0/InterfaceQT/monPlusieursBasePanel.py --- eficas-1.15.0.orig/InterfaceQT/monPlusieursBasePanel.py 2008-12-08 14:54:04.000000000 +0100 +++ eficas-1.15.0/InterfaceQT/monPlusieursBasePanel.py 2009-01-12 15:59:04.000000000 +0100 @@ -60,7 +60,7 @@ def BuildLBValeurs(self): # redefinit en raison de l heritage par monFonctionPanel - SaisieValeur.BuildLBValeurs(self) + SaisieValeur.BuildLBValeurs(self,politique=self.politique) def BOkPourListePressed(self): if self.listeValeursCourantes == [] : @@ -91,9 +91,11 @@ def Ajout1Valeur(self,valeur=None): - liste,validite=SaisieValeur.TraiteLEValeur(self,valeur) + liste,validite,texteBrut=SaisieValeur.TraiteLEValeur(self,valeur) if validite == 0 : return if liste ==[] : return + for val in texteBrut.split(',') : + self.politique.AjoutDsDictReel(val) index=self.LBValeurs.currentItem() + 1 listeVal=[] diff -urN eficas-1.15.0.orig/InterfaceQT/monSelectVal.py eficas-1.15.0/InterfaceQT/monSelectVal.py --- eficas-1.15.0.orig/InterfaceQT/monSelectVal.py 2008-12-08 14:54:04.000000000 +0100 +++ eficas-1.15.0/InterfaceQT/monSelectVal.py 2009-01-12 15:59:04.000000000 +0100 @@ -44,6 +44,7 @@ self.initVal() def readVal(self): + if self.file == "" : return f = open(self.file, "rb") self.texte = f.read() f.close() @@ -62,6 +63,7 @@ def BImportSelPressed(self): text=str(self.TBtext.selectedText()) self.textTraite=text + if self.textTraite == "" : return self.Traitement() def BImportToutPressed(self): @@ -75,10 +77,11 @@ liste1=self.textTraite.split(self.separateur) liste=[] for val in liste1 : - val=str(val) - try : - val=eval(val,{}) - except : - pass - liste.append(val) + if val != '' and val != ' ' and val != self.separateur : + val=str(val) + try : + val2=eval(val,{}) + liste.append(val) + except : + pass self.FonctPanel.AjoutNValeur(liste) diff -urN eficas-1.15.0.orig/InterfaceQT/politiquesValidation.py eficas-1.15.0/InterfaceQT/politiquesValidation.py --- eficas-1.15.0.orig/InterfaceQT/politiquesValidation.py 2008-12-08 14:54:04.000000000 +0100 +++ eficas-1.15.0/InterfaceQT/politiquesValidation.py 2009-01-12 15:59:04.000000000 +0100 @@ -59,7 +59,7 @@ def SetValeurTexte(self,texteValeur) : try : if "R" in self.node.item.object.definition.type: - if texteValeur[0] != "'": + if str(texteValeur)[0] != "'": clef=eval(texteValeur) if str(clef) != str(texteValeur) : self.node.item.object.init_modif() @@ -72,6 +72,23 @@ except: pass + def AjoutDsDictReel(self,texteValeur): + try : + #if 1 : + if "R" in self.node.item.object.definition.type: + if str(texteValeur)[0] != "'": + clef=eval(texteValeur) + if str(clef) != str(texteValeur) : + clefobj=self.node.item.object.GetNomConcept() + if not self.parent.dict_reels.has_key(clefobj): + self.parent.dict_reels[clefobj] = {} + self.parent.dict_reels[clefobj][clef]=texteValeur + self.parent.dict_reels[clefobj] + except: + #else: + #print "pb ds try de AjoutDsDictReel" + pass + def GetValeurTexte(self,valeur) : valeurTexte=valeur if "R" in self.node.item.object.definition.type: @@ -106,9 +123,9 @@ return validite, commentaire -#------------------------ -class PolitiquePlusieurs: -#------------------------ +#------------------------------------- +class PolitiquePlusieurs (Validation): +#------------------------------------- """ classe servant pour les entrees ne demandant qu un mot clef """ @@ -127,11 +144,10 @@ if not( type(listevaleur) in (types.ListType,types.TupleType)) : listevaleur=tuple(listevaleur) for valeur in listevaleur : + valeurScientifique=valeur # On teste le type de la valeur valide=self.node.item.valide_item(valeur) if not valide : - #print self.__class__ - #if not testtype : try : valeur,valide=self.node.item.eval_valeur(valeur) valide,commentaire = self.node.item.object.verif_type(valeur) @@ -153,8 +169,10 @@ commentaire="La liste a déjà atteint le nombre maximum d'éléments,ajout refusé" return valide,commentaire,commentaire2,listeRetour if len(listecourante) + 1 > min : + commentaire="" return valide,commentaire,commentaire2,listeRetour # On ajoute la valeur testee a la liste courante et a la liste acceptee + self.AjoutDsDictReel(valeurScientifique) listecourante.insert(index,valeur) index=index+1 listeRetour.append(valeur) diff -urN eficas-1.15.0.orig/InterfaceQT/qtSaisie.py eficas-1.15.0/InterfaceQT/qtSaisie.py --- eficas-1.15.0.orig/InterfaceQT/qtSaisie.py 2008-12-08 14:54:04.000000000 +0100 +++ eficas-1.15.0/InterfaceQT/qtSaisie.py 2009-01-12 15:59:04.000000000 +0100 @@ -45,11 +45,14 @@ self.listBoxASSD.setCurrentItem(0) - def BuildLBValeurs(self): + def BuildLBValeurs(self,politique=None): self.LBValeurs.clear() listeValeurs=self.node.item.GetListeValeurs() for valeur in listeValeurs: - self.LBValeurs.insertItem(str(valeur)) + if politique : + self.LBValeurs.insertItem(str(self.politique.GetValeurTexte(valeur))) + else : + self.LBValeurs.insertItem(str(valeur)) if listeValeurs != None and listeValeurs != [] : self.LBValeurs.setCurrentItem(len(listeValeurs) - 1) @@ -116,7 +119,7 @@ valeurBrute=str(self.LEValeur.text()) else : valeurBrute=valeurTraitee - if valeurBrute == str("") : return listeValeurs,1 + if valeurBrute == str("") : return listeValeurs,1,valeurBrute try : valeur=eval(valeurBrute,{}) except : @@ -134,7 +137,7 @@ except : commentaire = "Veuillez entrer le complexe sous forme aster ou sous forme python" self.editor.affiche_infos(commentaire) - return listeValeurs,0 + return listeValeurs,0,valeurBrute else : # ce n'est pas un tuple à la mode aster @@ -150,7 +153,7 @@ else: listeValeurs.append(valeur) - return listeValeurs,1 + return listeValeurs,1,valeurBrute class SaisieSDCO : diff -urN eficas-1.15.0.orig/InterfaceQT/readercata.py eficas-1.15.0/InterfaceQT/readercata.py --- eficas-1.15.0.orig/InterfaceQT/readercata.py 2008-12-08 14:54:04.000000000 +0100 +++ eficas-1.15.0/InterfaceQT/readercata.py 2009-01-12 15:59:04.000000000 +0100 @@ -51,6 +51,7 @@ self.parent=parent self.code=self.appli.code self.appli.format_fichier='python' + self.appli.appliEficas.format_fichier='python' self.version_code=self.appli.version_code self.version_cata=None self.fic_cata=None @@ -81,10 +82,12 @@ if self.version_code == cata[1]: self.fic_cata = cata[2] self.appli.format_fichier=cata[3] + self.appli.appliEficas.format_fichier=cata[3] elif len(liste_cata_possibles)==1: self.fic_cata = liste_cata_possibles[0][2] self.version_code = liste_cata_possibles[0][1] self.appli.format_fichier=liste_cata_possibles[0][3] + self.appli.appliEficas.format_fichier=liste_cata_possibles[0][3] lab=QString("Eficas V1.") lab+=QString(version) lab+=QString(" pour ") @@ -326,6 +329,7 @@ self.fic_cata = self.dico_catalogues[self.version_cata][2] self.version_code = self.version_cata self.appli.format_fichier = self.dico_catalogues[self.version_cata][3] + self.appli.appliEficas.format_fichier = self.dico_catalogues[self.version_cata][3] lab+=self.version_cata self.appli.parent.ui.setCaption(lab) #qApp.mainWidget().setCaption(lab) diff -urN eficas-1.15.0.orig/InterfaceTK/catabrowser.py eficas-1.15.0/InterfaceTK/catabrowser.py --- eficas-1.15.0.orig/InterfaceTK/catabrowser.py 2008-12-08 14:54:03.000000000 +0100 +++ eficas-1.15.0/InterfaceTK/catabrowser.py 2009-01-12 15:59:04.000000000 +0100 @@ -36,7 +36,7 @@ from Accas import FACT,BLOC,SIMP # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: catabrowser.py,v 1.2.4.1 2008-11-13 10:35:11 cchris Exp $" # class Tableau: diff -urN eficas-1.15.0.orig/InterfaceTK/cataediteur.py eficas-1.15.0/InterfaceTK/cataediteur.py --- eficas-1.15.0.orig/InterfaceTK/cataediteur.py 2008-12-08 14:54:03.000000000 +0100 +++ eficas-1.15.0/InterfaceTK/cataediteur.py 2009-01-12 15:59:04.000000000 +0100 @@ -39,7 +39,7 @@ import definition_cata # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: cataediteur.py,v 1.2.4.1 2008-11-13 10:35:11 cchris Exp $" # diff -urN eficas-1.15.0.orig/InterfaceTK/compomacro.py eficas-1.15.0/InterfaceTK/compomacro.py --- eficas-1.15.0.orig/InterfaceTK/compomacro.py 2008-12-08 14:54:03.000000000 +0100 +++ eficas-1.15.0/InterfaceTK/compomacro.py 2009-01-12 15:59:04.000000000 +0100 @@ -36,7 +36,7 @@ from widgets import showinfo,showerror # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: compomacro.py,v 1.2.4.1 2008-11-13 10:35:11 cchris Exp $" # diff -urN eficas-1.15.0.orig/InterfaceTK/componuplet.py eficas-1.15.0/InterfaceTK/componuplet.py --- eficas-1.15.0.orig/InterfaceTK/componuplet.py 2008-12-08 14:54:03.000000000 +0100 +++ eficas-1.15.0/InterfaceTK/componuplet.py 2009-01-12 15:59:04.000000000 +0100 @@ -30,7 +30,7 @@ import panels # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: componuplet.py,v 1.2.4.1 2008-11-13 10:35:11 cchris Exp $" # diff -urN eficas-1.15.0.orig/InterfaceTK/treewidget.py eficas-1.15.0/InterfaceTK/treewidget.py --- eficas-1.15.0.orig/InterfaceTK/treewidget.py 2008-12-08 14:54:04.000000000 +0100 +++ eficas-1.15.0/InterfaceTK/treewidget.py 2009-01-12 15:59:04.000000000 +0100 @@ -27,7 +27,7 @@ from Ihm import CONNECTOR # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: treewidget.py,v 1.2.4.1 2008-11-13 10:35:11 cchris Exp $" # diff -urN eficas-1.15.0.orig/Ui/OptionsEditeur.py eficas-1.15.0/Ui/OptionsEditeur.py --- eficas-1.15.0.orig/Ui/OptionsEditeur.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/OptionsEditeur.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'OptionsEditeur.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/OptionsPdf.py eficas-1.15.0/Ui/OptionsPdf.py --- eficas-1.15.0.orig/Ui/OptionsPdf.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/OptionsPdf.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'OptionsPdf.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/aideQT.py eficas-1.15.0/Ui/aideQT.py --- eficas-1.15.0.orig/Ui/aideQT.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/aideQT.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'aideQT.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desChoixCata.py eficas-1.15.0/Ui/desChoixCata.py --- eficas-1.15.0.orig/Ui/desChoixCata.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desChoixCata.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desChoixCata.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desCommande.py eficas-1.15.0/Ui/desCommande.py --- eficas-1.15.0.orig/Ui/desCommande.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desCommande.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desCommande.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desCommentaire.py eficas-1.15.0/Ui/desCommentaire.py --- eficas-1.15.0.orig/Ui/desCommentaire.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desCommentaire.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desCommentaire.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desError.py eficas-1.15.0/Ui/desError.py --- eficas-1.15.0.orig/Ui/desError.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desError.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desError.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desFormule.py eficas-1.15.0/Ui/desFormule.py --- eficas-1.15.0.orig/Ui/desFormule.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desFormule.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desFormule.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desInactif.py eficas-1.15.0/Ui/desInactif.py --- eficas-1.15.0.orig/Ui/desInactif.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desInactif.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desInactif.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desInclude.py eficas-1.15.0/Ui/desInclude.py --- eficas-1.15.0.orig/Ui/desInclude.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desInclude.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desInclude.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desListeParam.py eficas-1.15.0/Ui/desListeParam.py --- eficas-1.15.0.orig/Ui/desListeParam.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desListeParam.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desListeParam.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desMCFact.py eficas-1.15.0/Ui/desMCFact.py --- eficas-1.15.0.orig/Ui/desMCFact.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desMCFact.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desMCFact.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desMCListAjout.py eficas-1.15.0/Ui/desMCListAjout.py --- eficas-1.15.0.orig/Ui/desMCListAjout.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desMCListAjout.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desMCListAjout.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desMacro.py eficas-1.15.0/Ui/desMacro.py --- eficas-1.15.0.orig/Ui/desMacro.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desMacro.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desMacro.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desParam.py eficas-1.15.0/Ui/desParam.py --- eficas-1.15.0.orig/Ui/desParam.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desParam.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desParam.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desPlusieursBase.py eficas-1.15.0/Ui/desPlusieursBase.py --- eficas-1.15.0.orig/Ui/desPlusieursBase.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desPlusieursBase.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desPlusieursBase.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desPlusieursInto.py eficas-1.15.0/Ui/desPlusieursInto.py --- eficas-1.15.0.orig/Ui/desPlusieursInto.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desPlusieursInto.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desPlusieursInto.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desPoursuite.py eficas-1.15.0/Ui/desPoursuite.py --- eficas-1.15.0.orig/Ui/desPoursuite.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desPoursuite.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desPoursuite.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desRacine.py eficas-1.15.0/Ui/desRacine.py --- eficas-1.15.0.orig/Ui/desRacine.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desRacine.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desRacine.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desSelectVal.py eficas-1.15.0/Ui/desSelectVal.py --- eficas-1.15.0.orig/Ui/desSelectVal.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desSelectVal.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desSelectVal.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desUniqueASSD.py eficas-1.15.0/Ui/desUniqueASSD.py --- eficas-1.15.0.orig/Ui/desUniqueASSD.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desUniqueASSD.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desUniqueASSD.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desUniqueBase.py eficas-1.15.0/Ui/desUniqueBase.py --- eficas-1.15.0.orig/Ui/desUniqueBase.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desUniqueBase.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desUniqueBase.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desUniqueComp.py eficas-1.15.0/Ui/desUniqueComp.py --- eficas-1.15.0.orig/Ui/desUniqueComp.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desUniqueComp.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desUniqueComp.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desUniqueInto.py eficas-1.15.0/Ui/desUniqueInto.py --- eficas-1.15.0.orig/Ui/desUniqueInto.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desUniqueInto.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desUniqueInto.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desUniqueSDCO.py eficas-1.15.0/Ui/desUniqueSDCO.py --- eficas-1.15.0.orig/Ui/desUniqueSDCO.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desUniqueSDCO.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desUniqueSDCO.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desUniqueSDCOInto.py eficas-1.15.0/Ui/desUniqueSDCOInto.py --- eficas-1.15.0.orig/Ui/desUniqueSDCOInto.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desUniqueSDCOInto.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desUniqueSDCOInto.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/desVisu.py eficas-1.15.0/Ui/desVisu.py --- eficas-1.15.0.orig/Ui/desVisu.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/desVisu.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desVisu.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/Ui/myMain.py eficas-1.15.0/Ui/myMain.py --- eficas-1.15.0.orig/Ui/myMain.py 2008-12-08 15:32:10.000000000 +0100 +++ eficas-1.15.0/Ui/myMain.py 2009-01-13 14:22:17.000000000 +0100 @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'myMain.ui' # -# Created: lun déc 8 15:32:10 2008 +# Created: mar jan 13 14:22:17 2009 # by: The PyQt User Interface Compiler (pyuic) 3.17.4 # # WARNING! All changes made in this file will be lost! diff -urN eficas-1.15.0.orig/convert/Parserv5/conv.py eficas-1.15.0/convert/Parserv5/conv.py --- eficas-1.15.0.orig/convert/Parserv5/conv.py 2008-12-08 14:54:08.000000000 +0100 +++ eficas-1.15.0/convert/Parserv5/conv.py 2009-01-12 15:59:07.000000000 +0100 @@ -30,7 +30,7 @@ "" # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: conv.py,v 1.6 2004-09-10 15:52:11 eficas Exp $" # diff -urN eficas-1.15.0.orig/convert/Parserv5/tables.py eficas-1.15.0/convert/Parserv5/tables.py --- eficas-1.15.0.orig/convert/Parserv5/tables.py 2008-12-08 14:54:08.000000000 +0100 +++ eficas-1.15.0/convert/Parserv5/tables.py 2009-01-12 15:59:07.000000000 +0100 @@ -29,7 +29,7 @@ from TextTools import * # -__version__="$Name: V1_15a2 $" +__version__="$Name: V1_15a4 $" __Id__="$Id: tables.py,v 1.5 2004-09-10 15:52:11 eficas Exp $" # diff -urN eficas-1.15.0.orig/generator/OpenturnsBase.py eficas-1.15.0/generator/OpenturnsBase.py --- eficas-1.15.0.orig/generator/OpenturnsBase.py 2008-12-08 14:54:08.000000000 +0100 +++ eficas-1.15.0/generator/OpenturnsBase.py 2009-01-12 15:59:07.000000000 +0100 @@ -30,11 +30,12 @@ ListeVariables : chaque variable est decrite par un dictionnaire ; cette liste les regroupe DictLois : dictionnaires des lois ''' - def __init__ (self, appli, DictMCVal, ListeVariables, DictLois ) : + def __init__ (self, appli, DictMCVal = {}, ListeVariables = [], DictLois = {}, DictVariables = {} ) : #---------------------------------------------------------# self.ListeVariables = ListeVariables self.ListeVariablesIn = [] self.DictLois = DictLois + self.DictVariables = DictVariables self.DictMCVal = DictMCVal self.DictTypeVar = {} self.nbVarIn = 0 @@ -72,7 +73,7 @@ monXMLGenerateur=gener( self.DictMCVal, self.ListeVariables, self.DictLois ) except : from OpenturnsXML import XMLGenerateur - monXMLGenerateur = XMLGenerateur( self.appli, self.DictMCVal, self.ListeVariables, self.DictLois ) + monXMLGenerateur = XMLGenerateur( self.appli, self.DictMCVal, self.DictVariables ) return monXMLGenerateur def creeInfoVar (self) : diff -urN eficas-1.15.0.orig/generator/OpenturnsSTD.py eficas-1.15.0/generator/OpenturnsSTD.py --- eficas-1.15.0.orig/generator/OpenturnsSTD.py 2008-12-08 14:54:08.000000000 +0100 +++ eficas-1.15.0/generator/OpenturnsSTD.py 2009-01-12 15:59:07.000000000 +0100 @@ -27,15 +27,19 @@ import sys sys.path.append( '%s' ) +# Chargement du module math +import math + # Chargement du module Open TURNS from openturns import * +from openturns_viewer import ViewImage,StopViewer,WaitForViewer """ footerSTD = """ # Terminaison du fichier -sys.exit( 0 ) +#sys.exit( 0 ) """ #============================================= @@ -59,11 +63,31 @@ # Ce dictionnaire fait la correspondance entre le mot lu dans le dictionnaire des mots-clefs et la methode a appeler self.traitement = { - "Min/Max" : "MinMax", - "Central Uncertainty" : "CentralUncertainty", - "Threshold Exceedence" : "ThresholdExceedence", - "Experiment Plane" : "ExperimentPlane", - "Random Sampling" : "RandomSampling", + "Min/Max" : + ( "MinMax", + { "Experiment Plane" : "ExperimentPlane", + "Random Sampling" : "MinMaxRandomSampling", + }, + ), + "Central Uncertainty" : + ( "CentralUncertainty", + { "Taylor Variance Decomposition" : "TaylorVarianceDecomposition", + "Random Sampling" : "CentralUncertaintyRandomSampling", + }, + ), + "Threshold Exceedence" : + ( "ThresholdExceedence", + { "Simulation" : "Simulation", + "Analytical" : "Analytical", + "MonteCarlo" : "MonteCarlo", + "LHS" : "LHS", + "ImportanceSampling" : "ImportanceSampling", + "FirstOrder" : "FORM", + "SecondOrder" : "SORM", + "Cobyla" : "Cobyla", + "AbdoRackwitz" : "AbdoRackwitz", + }, + ), } # Ce dictionnaire liste le nom des variables utilisees dans le script @@ -91,6 +115,51 @@ "copula" : "copula", "inputRandomVector" : "inputRandomVector", "outputRandomVector" : "outputRandomVector", + "myQuadraticCumul" : "myQuadraticCumul", + "meanFirstOrder" : "meanFirstOrder", + "meanSecondOrder" : "meanSecondOrder", + "standardDeviationFirstOrder" : "standardDeviationFirstOrder", + "importanceFactors" : "importanceFactors", + "importanceFactorsGraph" : "importanceFactorsGraph", + "importanceFactorsDrawing" : "importanceFactorsDrawing", + "empiricalMean" : "empiricalMean", + "empiricalStandardDeviation" : "empiricalStandardDeviation", + "empiricalQuantile" : "empiricalQuantile", + "alpha" : "alpha", + "beta" : "beta", + "PCCcoefficient" : "PCCcoefficient", + "PRCCcoefficient" : "PRCCcoefficient", + "SRCcoefficient" : "SRCcoefficient", + "SRRCcoefficient" : "SRRCcoefficient", + "kernel" : "kernel", + "kernelSmoothedDist" : "kernelSmoothedDist", + "kernelSmoothedPDF" : "kernelSmoothedPDF", + "myEvent" : "myEvent", + "myAlgo" : "myAlgo", + "myResult" : "myResult", + "probability" : "probability", + "standardDeviation" : "standardDeviation", + "level" : "level", + "length" : "length", + "coefficientOfVariation" : "coefficientOfVariation", + "convergenceGraph" : "convergenceGraph", + "iterations" : "iterations", + "myOptimizer" : "myOptimizer", + "specificParameters" : "specificParameters", + "startingPoint" : "startingPoint", + "hasoferReliabilityIndex" : "hasoferReliabilityIndex", + "standardSpaceDesignPoint" : "standardSpaceDesignPoint", + "physicalSpaceDesignPoint" : "physicalSpaceDesignPoint", + "eventProbabilitySensitivity" : "eventProbabilitySensitivity", + "hasoferReliabilityIndexSensitivity" : "hasoferReliabilityIndexSensitivity", + "eventProbabilitySensitivityGraph" : "eventProbabilitySensitivityGraph", + "hasoferReliabilityIndexSensitivityGraph" : "hasoferReliabilityIndexSensitivityGraph", + "modelEvaluationCalls" : "modelEvaluationCalls", + "modelGradientCalls" : "modelGradientCalls", + "modelHessianCalls" : "modelHessianCalls", + "tvedtApproximation" : "tvedtApproximation", + "hohenBichlerApproximation" : "hohenBichlerApproximation", + "breitungApproximation" : "breitungApproximation", } # Ce dictionnaire fait la correspondance entre le mot-clef du catalogue et le flag de la bibliotheque @@ -112,11 +181,12 @@ TypeAnalyse = self.DictMCVal[ 'Type' ] Traitement = None + subDict = {} if ( self.traitement.has_key( TypeAnalyse ) ): - Traitement = self.traitement[ TypeAnalyse ] + (Traitement, subDict) = self.traitement[ TypeAnalyse ] if ( Traitement is not None ): - self.texteSTD = apply( STDGenerateur.__dict__[ Traitement ], (self,) ) + self.texteSTD = apply( STDGenerateur.__dict__[ Traitement ], (self, subDict) ) return self.texteSTD @@ -144,7 +214,7 @@ ''' return footerSTD - def MinMax (self): + def MinMax (self, subDict): ''' Produit le fichier study correspondant a une analyse Min/Max ''' @@ -158,8 +228,8 @@ Methode = self.DictMCVal[ 'Method' ] Traitement = None - if ( self.traitement.has_key( Methode ) ): - Traitement = self.traitement[ Methode ] + if ( subDict.has_key( Methode ) ): + Traitement = subDict[ Methode ] if ( Traitement is not None ): txt += apply( STDGenerateur.__dict__[ Traitement ], (self,) ) @@ -175,8 +245,9 @@ Importe le modele physique ''' fonction = None - if ( self.DictMCVal.has_key( 'Name' ) ): - fonction = self.DictMCVal[ 'Name' ] + if ( self.DictMCVal.has_key( 'FileName' ) ): + name = self.DictMCVal[ 'FileName' ] + fonction = name[name.rfind('/')+1:name.rfind('.xml')] txt = "# Charge le modele physique\n" txt += "%s = NumericalMathFunction( '%s' )\n" % (self.variable["model"], fonction) @@ -197,7 +268,7 @@ txt += "\n" return txt - def RandomSampling (self): + def MinMaxRandomSampling (self): ''' Etude par echantillonage aleatoire ''' @@ -218,11 +289,20 @@ Cree la loi jointe des variables d entree ''' txt = "# Definit la loi jointe des variables d'entree\n" - txt += "%s = DistributionCollection( %d )\n" % (self.variable["collection"], len( self.DictLois )) + txt += "%s = DistributionCollection( %d )\n" % (self.variable["collection"], len( self.ListeVariables )) txt += "\n" + + dictVariables = {} + for variable in self.ListeVariables: + nomVar = variable['ModelVariable'].get_name() + dictVariables[ nomVar ] = variable['Distribution'] + i = 0 - for concept in self.DictLois.keys(): - loi = self.DictLois[ concept ] + sortedVarNames = dictVariables.keys() + sortedVarNames.sort() + for variable in sortedVarNames: + conceptloi = dictVariables[ variable ] + loi = self.DictLois[ conceptloi ] if loi.has_key( 'Kind' ): marginale = "%s_%d" % (self.variable["marginal"], i) txt += "# Definit la loi marginale de la composante %d\n" % i @@ -231,19 +311,19 @@ txt += "\n" i += 1 - txt += self.Copula() + txt += self.Copula( len( self.ListeVariables ) ) txt += "# Definit la loi jointe\n" txt += "%s = ComposedDistribution( %s, Copula( %s ) )\n" % (self.variable["distribution"], self.variable["collection"], self.variable["copula"]) txt += "\n" return txt - def Copula (self): + def Copula (self, dimension): ''' Cree la copule de la loi jointe ''' txt = "# Definit la copule de la loi jointe\n" - txt += "%s = IndependentCopula()\n" % self.variable["copula"] + txt += "%s = IndependentCopula( %d )\n" % (self.variable["copula"], dimension) txt += "\n" return txt @@ -256,6 +336,15 @@ txt += "\n" return txt + def OutputRandomVector (self): + ''' + Cree le vector aleatoire de sortie + ''' + txt = "# Definit le vecteur aleatoire de sortie\n" + txt += "%s = RandomVector( %s, %s )\n" % (self.variable["outputRandomVector"], self.variable["model"], self.variable["inputRandomVector"]) + txt += "\n" + return txt + def ScaledVector (self): ''' Definit les coefficients multiplicateurs par composante du vecteur @@ -335,31 +424,561 @@ ''' txt = "# Resultats\n" txt += "%s = %s.getMin()\n" % (self.variable["minValue"], self.variable["outputSample"]) - txt += "%s = %s.getMax()\n" % (self.variable["maxValue"], self.variable["outputSample"]) - txt += "\n" txt += "print '%s = ', %s\n" % (self.variable["minValue"], self.variable["minValue"]) + txt += "\n" + txt += "%s = %s.getMax()\n" % (self.variable["maxValue"], self.variable["outputSample"]) txt += "print '%s = ', %s\n" % (self.variable["maxValue"], self.variable["maxValue"]) txt += "\n" return txt - def CentralUncertainty (self): + def CentralUncertainty (self, subDict): ''' Produit le fichier study correspondant a une analyse d incertitude en valeur centrale ''' txt = self.Header() - txt += "# Etude 'Central Uncertainty'\n\n" + txt += "# Etude 'Central Uncertainty'\n" + + txt += self.Model() + txt += self.InputDistribution() + txt += self.InputRandomVector() + txt += self.OutputRandomVector() + + Methode = None + if ( self.DictMCVal.has_key( 'Method' ) ): + Methode = self.DictMCVal[ 'Method' ] + + Traitement = None + if ( subDict.has_key( Methode ) ): + Traitement = subDict[ Methode ] + + if ( Traitement is not None ): + txt += apply( STDGenerateur.__dict__[ Traitement ], (self,) ) + txt += self.Footer() return txt - def ThresholdExceedence (self): + + def TaylorVarianceDecomposition (self): + ''' + Etude par decomposition de Taylor + ''' + txt = "# Cumul quadratique (decomposition de Taylor)\n" + txt += "%s = QuadraticCumul( %s )\n" % (self.variable["myQuadraticCumul"], self.variable["outputRandomVector"]) + txt += "\n" + txt += "# Resultats\n" + + if ( self.DictMCVal.has_key( 'MeanFirstOrder' ) ): + if ( self.DictMCVal[ 'MeanFirstOrder' ] == "yes" ): + txt += "%s = %s.getMeanFirstOrder()\n" % (self.variable["meanFirstOrder"], self.variable["myQuadraticCumul"]) + txt += "print '%s = ', %s\n" % (self.variable["meanFirstOrder"], self.variable["meanFirstOrder"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'MeanSecondOrder' ) ): + if ( self.DictMCVal[ 'MeanSecondOrder' ] == "yes" ): + txt += "%s = %s.getMeanSecondOrder()\n" % (self.variable["meanSecondOrder"], self.variable["myQuadraticCumul"]) + txt += "print '%s = ', %s\n" % (self.variable["meanSecondOrder"], self.variable["meanSecondOrder"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'StandardDeviationFirstOrder' ) ): + if ( self.DictMCVal[ 'StandardDeviationFirstOrder' ] == "yes" ): + txt += "%s = %s.getCovariance()\n" % (self.variable["standardDeviationFirstOrder"], self.variable["myQuadraticCumul"]) + txt += "dim = %s.getDimension()\n" % self.variable["standardDeviationFirstOrder"] + txt += "for i in range( dim ):\n" + txt += " %s[ i, i ] = math.sqrt( %s[ i, i ] )\n" % (self.variable["standardDeviationFirstOrder"], self.variable["standardDeviationFirstOrder"]) + txt += "print '%s = ', %s\n" % (self.variable["standardDeviationFirstOrder"], self.variable["standardDeviationFirstOrder"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'NumericalResults' ) ): + if ( self.DictMCVal[ 'NumericalResults' ] == "yes" ): + txt += "if ( %s.getDimension() == 1):\n" % self.variable["outputRandomVector"] + txt += " %s = %s.getImportanceFactors()\n" % (self.variable["importanceFactors"], self.variable["myQuadraticCumul"]) + txt += " print '%s = ', %s\n" % (self.variable["importanceFactors"], self.variable["importanceFactors"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'GraphicalResults' ) ): + if ( self.DictMCVal[ 'GraphicalResults' ] == "yes" ): + txt += "%s = %s.drawImportanceFactors()\n" % (self.variable["importanceFactorsGraph"], self.variable["myQuadraticCumul"]) + txt += "Show( %s )\n" % self.variable["importanceFactorsGraph"] + txt += "%s.draw( '%s' )\n" % (self.variable["importanceFactorsGraph"], self.variable["importanceFactorsDrawing"]) + txt += "ViewImage( %s.getBitmap() )\n" % self.variable["importanceFactorsGraph"] + txt += "print 'bitmap =', %s.getBitmap()\n" % self.variable["importanceFactorsGraph"] + txt += "print 'postscript =', %s.getPostscript()\n" % self.variable["importanceFactorsGraph"] + txt += "\n" + + txt += "\n" + return txt + + def CentralUncertaintyRandomSampling (self): + ''' + Etude par echantillonage aleatoire + ''' + size = 0 + if ( self.DictMCVal.has_key( 'PointsNumber' ) ): + size = self.DictMCVal[ 'PointsNumber' ] + + txt = "# Echantillonnage aleatoire de la variable de sortie\n" + txt += "%s = %d\n" % (self.variable["inSize"], size) + txt += "%s = %s.getNumericalSample( %s )\n" % (self.variable["outputSample"], self.variable["outputRandomVector"], self.variable["inSize"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'EmpiricalMean' ) ): + if ( self.DictMCVal[ 'EmpiricalMean' ] == "yes" ): + txt += "%s = %s.computeMean()\n" % (self.variable["empiricalMean"], self.variable["outputSample"]) + txt += "print '%s =', %s\n" % (self.variable["empiricalMean"], self.variable["empiricalMean"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'EmpiricalStandardDeviation' ) ): + if ( self.DictMCVal[ 'EmpiricalStandardDeviation' ] == "yes" ): + txt += "%s = %s.computeCovariance()\n" % (self.variable["empiricalStandardDeviation"], self.variable["outputSample"]) + txt += "dim = %s.getDimension()\n" % self.variable["empiricalStandardDeviation"] + txt += "for i in range( dim ):\n" + txt += " %s[ i, i ] = math.sqrt( %s[ i, i ] )\n" % (self.variable["empiricalStandardDeviation"], self.variable["empiricalStandardDeviation"]) + txt += "print '%s = ', %s\n" % (self.variable["empiricalStandardDeviation"], self.variable["empiricalStandardDeviation"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'EmpiricalQuantile_Order' ) ): + ordre = self.DictMCVal[ 'EmpiricalQuantile_Order' ] + txt += "%s = %s.computeQuantile( %s )\n" % (self.variable["empiricalQuantile"], self.variable["outputSample"], ordre) + txt += "print '%s =', %s\n" % (self.variable["empiricalQuantile"], self.variable["empiricalQuantile"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'AnalysedCorrelations' ) ): + if ( self.DictMCVal[ 'AnalysedCorrelations' ] == "yes" ): + txt += "# Ou est le %s ?\n" % self.variable["inputSample"] + txt += "#if ( ( %s.getDimension() == 1 ) and ( %s.getDimension() == 1 ) ):\n" % (self.variable["inputSample"], self.variable["outputSample"]) + txt += "# %s = CorrelationAnalysis.PCC( %s, %s )\n" % (self.variable["PCCcoefficient"], self.variable["inputSample"], self.variable["outputSample"]) + txt += "# print '%s = ', %s\n" % (self.variable["PCCcoefficient"], self.variable["PCCcoefficient"]) + txt += "# %s = CorrelationAnalysis.PRCC( %s, %s )\n" % (self.variable["PRCCcoefficient"], self.variable["inputSample"], self.variable["outputSample"]) + txt += "# print '%s = ', %s\n" % (self.variable["PRCCcoefficient"], self.variable["PRCCcoefficient"]) + txt += "# %s = CorrelationAnalysis.SRC( %s, %s )\n" % (self.variable["SRCcoefficient"], self.variable["inputSample"], self.variable["outputSample"]) + txt += "# print '%s = ', %s\n" % (self.variable["SRCcoefficient"], self.variable["SRCcoefficient"]) + txt += "# %s = CorrelationAnalysis.SRRC( %s, %s )\n" % (self.variable["SRRCcoefficient"], self.variable["inputSample"], self.variable["outputSample"]) + txt += "# print '%s = ', %s\n" % (self.variable["SRRCcoefficient"], self.variable["SRRCcoefficient"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'KernelSmoothing' ) ): + if ( self.DictMCVal[ 'KernelSmoothing' ] == "yes" ): + txt += "# Kernel Smoohing\n" + txt += "%s = KernelSmoothing()\n" % self.variable["kernel"] + txt += "if ( %s.getDimension() == 1 ):\n" % self.variable["outputSample"] + txt += " %s = %s.buildImplementation( %s, 'TRUE')\n" % (self.variable["kernelSmoothedDist"], self.variable["kernel"], self.variable["outputSample"]) + txt += " %s = %s.drawPDF()\n" % (self.variable["kernelSmoothedPDF"], self.variable["kernelSmoothedDist"]) + txt += " Show( %s )\n" % self.variable["kernelSmoothedPDF"] + txt += "\n" + + return txt + + def ThresholdExceedence (self, subDict): ''' Produit le fichier study correspondant a une analyse de depassement de seuil ''' txt = self.Header() - txt += "# Etude 'Threshold Exceedence'\n\n" + txt += "# Etude 'Threshold Exceedence'\n" + + txt += self.RandomGenerator() + txt += self.Model() + txt += self.InputDistribution() + txt += self.InputRandomVector() + txt += self.OutputRandomVector() + txt += self.Event() + + Methode = None + if ( self.DictMCVal.has_key( 'Method' ) ): + Methode = self.DictMCVal[ 'Method' ] + + Traitement = None + if ( subDict.has_key( Methode ) ): + Traitement = subDict[ Methode ] + + if ( Traitement is not None ): + txt += apply( STDGenerateur.__dict__[ Traitement ], (self, subDict) ) + txt += self.Footer() return txt + def Simulation (self, subDict): + ''' + Methodes de simulation + ''' + Algorithme = None + if ( self.DictMCVal.has_key( 'Algorithm' ) ): + Algorithme = self.DictMCVal[ 'Algorithm' ] + + Traitement = None + if ( subDict.has_key( Algorithme ) ): + Traitement = subDict[ Algorithme ] + + if ( Traitement is not None ): + txt = apply( STDGenerateur.__dict__[ Traitement ], (self,) ) + + maxOuterSampling = None + if ( self.DictMCVal.has_key( 'MaximumOuterSampling' ) ): + maxOuterSampling = self.DictMCVal[ 'MaximumOuterSampling' ] + txt += "%s.setMaximumOuterSampling( %s )\n" % (self.variable["myAlgo"], maxOuterSampling) + + blockSize = None + if ( self.DictMCVal.has_key( 'BlockSize' ) ): + maxOuterSampling = self.DictMCVal[ 'BlockSize' ] + txt += "%s.setBlockSize( %s )\n" % (self.variable["myAlgo"], blockSize) + + maxCoefficientOfVariation = None + if ( self.DictMCVal.has_key( 'MaximumCoefficientOfVariation' ) ): + maxCoefficientOfVariation = self.DictMCVal[ 'MaximumCoefficientOfVariation' ] + txt += "%s.setMaximumCoefficientOfVariation( %s )\n" % (self.variable["myAlgo"], maxCoefficientOfVariation) + + txt += "%s.run()\n" % self.variable["myAlgo"] + txt += "\n" + txt += "# Resultats de la simulation\n" + txt += "%s = %s.getResult()\n" % (self.variable["myResult"], self.variable["myAlgo"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'Probability' ) ): + if ( self.DictMCVal[ 'Probability' ] == "yes" ): + txt += "%s = %s.getProbabilityEstimate()\n" % (self.variable["probability"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["probability"], self.variable["probability"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'StandardDeviation' ) ): + if ( self.DictMCVal[ 'StandardDeviation' ] == "yes" ): + txt += "%s = math.sqrt( %s.getProbabilityEstimate() )\n" % (self.variable["standardDeviation"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["standardDeviation"], self.variable["standardDeviation"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'ConfidenceInterval' ) and self.DictMCVal.has_key( 'Probability' ) ): + if ( ( self.DictMCVal[ 'ConfidenceInterval' ] == "yes" ) and ( self.DictMCVal[ 'Probability' ] == "yes" ) ): + level = self.DictMCVal[ 'Level' ] + txt += "%s = %s.getConfidenceLength( %s )\n" % (self.variable["length"], self.variable["myResult"], level) + txt += "print 'confidence interval at %s = [', %s-0.5*%s, ',', %s+0.5*%s, ']'\n" % (level, self.variable["probability"], self.variable["length"], self.variable["probability"], self.variable["length"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'VariationCoefficient' ) ): + if ( self.DictMCVal[ 'VariationCoefficient' ] == "yes" ): + txt += "%s = %s.getCoefficientOfVariation()\n" % (self.variable["coefficientOfVariation"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["coefficientOfVariation"], self.variable["coefficientOfVariation"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'IterationNumber' ) ): + if ( self.DictMCVal[ 'IterationNumber' ] == "yes" ): + txt += "%s = %s.getOuterSampling()\n" % (self.variable["iterations"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["iterations"], self.variable["iterations"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'ConvergenceGraph' ) ): + if ( self.DictMCVal[ 'ConvergenceGraph' ] == "yes" ): + txt += "%s = %s.drawProbabilityConvergence()\n" % (self.variable["convergenceGraph"], self.variable["myAlgo"]) + txt += "Show( %s )\n" % self.variable["convergenceGraph"] + txt += "\n" + + return txt + + def Analytical (self, subDict): + ''' + Methodes analytiques + ''' + txt = "" + + OptimizationAlgo = None + if ( self.DictMCVal.has_key( 'OptimizationAlgorithm' ) ): + OptimizationAlgo = self.DictMCVal[ 'OptimizationAlgorithm' ] + + Traitement = None + if ( subDict.has_key( OptimizationAlgo ) ): + Traitement = subDict[ OptimizationAlgo ] + + if ( Traitement is not None ): + txt += apply( STDGenerateur.__dict__[ Traitement ], (self,) ) + + txt += self.OptimizerSettings() + txt += self.PhysicalStartingPoint() + + Approximation = None + if ( self.DictMCVal.has_key( 'Approximation' ) ): + Approximation = self.DictMCVal[ 'Approximation' ] + + Traitement = None + if ( subDict.has_key( Approximation ) ): + Traitement = subDict[ Approximation ] + + if ( Traitement is not None ): + txt += apply( STDGenerateur.__dict__[ Traitement ], (self,) ) + + txt += self.RunAlgorithm() + txt += self.AnalyticalResult() + + return txt + + def OptimizerSettings (self): + ''' + Parametrage de l optimiseur + ''' + txt = "" + + iterations = None + if ( self.DictMCVal.has_key( 'MaximumIterationsNumber' ) ): + iterations = self.DictMCVal[ 'MaximumIterationsNumber' ] + txt += "%s.setMaximumIterationsNumber( %s )\n" % (self.variable["myOptimizer"], iterations) + + absoluteError = None + if ( self.DictMCVal.has_key( 'MaximumAbsoluteError' ) ): + absoluteError = self.DictMCVal[ 'MaximumAbsoluteError' ] + txt += "%s.setMaximumAbsoluteError( %s )\n" % (self.variable["myOptimizer"], absoluteError) + + relativeError = None + if ( self.DictMCVal.has_key( 'MaximumRelativeError' ) ): + relativeError = self.DictMCVal[ 'MaximumRelativeError' ] + txt += "%s.setMaximumRelativeError( %s )\n" % (self.variable["myOptimizer"], relativeError) + + residualError = None + if ( self.DictMCVal.has_key( 'MaximumResidualError' ) ): + residualError = self.DictMCVal[ 'MaximumResidualError' ] + txt += "%s.setMaximumResidualError( %s )\n" % (self.variable["myOptimizer"], residualError) + + constraintError = None + if ( self.DictMCVal.has_key( 'MaximumConstraintError' ) ): + constraintError = self.DictMCVal[ 'MaximumConstraintError' ] + txt += "%s.setMaximumConstraintError( %s )\n" % (self.variable["myOptimizer"], constraintError) + + txt += "\n" + + return txt + + def PhysicalStartingPoint (self): + ''' + Point physique de depart + ''' + txt = "# Point physique de depart\n" + + if ( self.DictMCVal.has_key( 'PhysicalStartingPoint' ) ): + point = self.DictMCVal[ 'PhysicalStartingPoint' ] + dimension = len( point ) + txt += "%s = NumericalPoint( %d )\n" % (self.variable["startingPoint"], dimension) + for i in range( dimension ): + txt += "%s[ %d ] = %g\n" % (self.variable["startingPoint"], i, point[i]) + else: + txt += "%s = %s.getMean()\n" % (self.variable["startingPoint"], self.variable["inputRandomVector"]) + + txt += "\n" + + return txt + + def AnalyticalResult (self): + ''' + Resultat des methodes analytiques + ''' + txt = "# Resultat des methodes analytiques\n" + txt += "%s = %s.getResult()\n" % (self.variable["myResult"], self.variable["myAlgo"]) + + if ( self.DictMCVal.has_key( 'Probability' ) ): + if ( self.DictMCVal[ 'Probability' ] == "yes" ): + txt += "%s = %s.getEventProbability()\n" % (self.variable["probability"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["probability"], self.variable["probability"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'HasoferReliabilityIndex' ) ): + if ( self.DictMCVal[ 'HasoferReliabilityIndex' ] == "yes" ): + txt += "%s = %s.getHasoferReliabilityIndex()\n" % (self.variable["hasoferReliabilityIndex"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["hasoferReliabilityIndex"], self.variable["hasoferReliabilityIndex"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'DesignPoint' ) ): + if ( self.DictMCVal[ 'DesignPoint' ] == "yes" ): + txt += "%s = %s.getStandardSpaceDesignPoint()\n" % (self.variable["standardSpaceDesignPoint"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["standardSpaceDesignPoint"], self.variable["standardSpaceDesignPoint"]) + txt += "%s = %s.getPhysicalSpaceDesignPoint()\n" % (self.variable["physicalSpaceDesignPoint"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["physicalSpaceDesignPoint"], self.variable["physicalSpaceDesignPoint"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'ImportanceFactorNumericalResults' ) ): + if ( self.DictMCVal[ 'ImportanceFactorNumericalResults' ] == "yes" ): + txt += "%s = %s.getImportanceFactors()\n" % (self.variable["importanceFactors"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["importanceFactors"], self.variable["importanceFactors"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'ImportanceFactorGraphicalResults' ) ): + if ( self.DictMCVal[ 'ImportanceFactorGraphicalResults' ] == "yes" ): + txt += "%s = %s.drawImportanceFactors()\n" % (self.variable["importanceFactorsGraph"], self.variable["myResult"]) + txt += "Show( %s )\n" % self.variable["importanceFactorsGraph"] + txt += "\n" + + if ( self.DictMCVal.has_key( 'FORMEventProbabilitySensitivityNumericalResults' ) ): + if ( self.DictMCVal[ 'FORMEventProbabilitySensitivityNumericalResults' ] == "yes" ): + txt += "%s = %s.getEventProbabilitySensitivity()\n" % (self.variable["eventProbabilitySensitivity"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["eventProbabilitySensitivity"], self.variable["eventProbabilitySensitivity"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'FORMEventProbabilitySensitivityGraphicalResults' ) ): + if ( self.DictMCVal[ 'FORMEventProbabilitySensitivityGraphicalResults' ] == "yes" ): + txt += "%s = %s.drawEventProbabilitySensitivity()\n" % (self.variable["eventProbabilitySensitivityGraph"], self.variable["myResult"]) + txt += "Show( %s[0] )\n" % self.variable["eventProbabilitySensitivityGraph"] + txt += "\n" + + if ( self.DictMCVal.has_key( 'HasoferReliabilityIndexSensitivityNumericalResults' ) ): + if ( self.DictMCVal[ 'HasoferReliabilityIndexSensitivityNumericalResults' ] == "yes" ): + txt += "%s = %s.getHasoferReliabilityIndexSensitivity()\n" % (self.variable["hasoferReliabilityIndexSensitivity"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["hasoferReliabilityIndexSensitivity"], self.variable["hasoferReliabilityIndexSensitivity"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'HasoferReliabilityIndexSensitivityGraphicalResults' ) ): + if ( self.DictMCVal[ 'HasoferReliabilityIndexSensitivityGraphicalResults' ] == "yes" ): + txt += "%s = %s.drawHasoferReliabilityIndexSensitivity()\n" % (self.variable["hasoferReliabilityIndexSensitivityGraph"], self.variable["myResult"]) + txt += "Show( %s[0] )\n" % self.variable["hasoferReliabilityIndexSensitivityGraph"] + txt += "\n" + + if ( self.DictMCVal.has_key( 'TvedtApproximation' ) ): + if ( self.DictMCVal[ 'TvedtApproximation' ] == "yes" ): + txt += "%s = %s.getEventProbabilityTvedt()\n" % (self.variable["tvedtApproximation"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["tvedtApproximation"], self.variable["tvedtApproximation"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'HohenBichlerApproximation' ) ): + if ( self.DictMCVal[ 'HohenBichlerApproximation' ] == "yes" ): + txt += "%s = %s.getEventProbabilityHohenBichler()\n" % (self.variable["hohenBichlerApproximation"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["hohenBichlerApproximation"], self.variable["tvedtApproximation"]) + txt += "\n" + + if ( self.DictMCVal.has_key( 'BreitungApproximation' ) ): + if ( self.DictMCVal[ 'BreitungApproximation' ] == "yes" ): + txt += "%s = %s.getEventProbabilityBreitung()\n" % (self.variable["breitungApproximation"], self.variable["myResult"]) + txt += "print '%s =', %s\n" % (self.variable["breitungApproximation"], self.variable["breitungApproximation"]) + txt += "\n" + + + return txt + + def RandomGenerator (self): + ''' + Generateur Aleatoire + ''' + txt = "" + + seed = None + if ( self.DictMCVal.has_key( 'RandomGeneratorSeed' ) ): + seed = self.DictMCVal[ 'RandomGeneratorSeed' ] + txt += "# Initialise le generateur aleatoire\n" + txt += "RandomGenerator.SetSeed( %s )\n" % seed + txt += "\n" + + return txt + + def Event (self): + ''' + Definition de l evenement de defaillance + ''' + operator = None + if ( self.DictMCVal.has_key( 'ComparisonOperator' ) ): + operator = self.DictMCVal[ 'ComparisonOperator' ] + + threshold = None + if ( self.DictMCVal.has_key( 'Threshold' ) ): + threshold = self.DictMCVal[ 'Threshold' ] + + txt = "# Evenement de defaillance\n" + txt += "%s = Event( %s, ComparisonOperator( %s() ), %s )\n" % (self.variable["myEvent"], self.variable["outputRandomVector"], operator, threshold) + txt += "\n" + return txt + + def MonteCarlo (self): + ''' + Methode de MonteCarlo + ''' + txt = "# Simulation par MonteCarlo\n" + txt += "%s = MonteCarlo( %s )\n" % (self.variable["myAlgo"], self.variable["myEvent"]) + txt += "\n" + + return txt + + def LHS (self): + ''' + Methode LHS + ''' + txt = "# Simulation par LHS\n" + txt += "%s = LHS( %s )\n" % (self.variable["myAlgo"], self.variable["myEvent"]) + txt += "\n" + + return txt + + def ImportanceSampling (self): + ''' + Methode de tirage d importance + ''' + txt = "# Simulation par Tirage d'importance\n" + txt += "%s = ImportanceSampling( %s )\n" % (self.variable["myAlgo"], self.variable["myEvent"]) + txt += "\n" + + return txt + + def FORM (self): + ''' + Methode FORM + ''' + txt = "# Algorithme FORM\n" + txt += "%s = FORM ( NearestPointAlgorithm( %s ), %s, %s )\n" % (self.variable["myAlgo"], self.variable["myOptimizer"], self.variable["myEvent"], self.variable["startingPoint"]) + txt += "\n" + + return txt + + def SORM (self): + ''' + Methode SORM + ''' + txt = "# Algorithme SORM\n" + txt += "%s = SORM ( NearestPointAlgorithm( %s ), %s, %s )\n" % (self.variable["myAlgo"], self.variable["myOptimizer"], self.variable["myEvent"], self.variable["startingPoint"]) + txt += "\n" + + return txt + + def RunAlgorithm (self): + ''' + Do the computation + ''' + if ( self.DictMCVal.has_key( 'FunctionCallsNumber' ) ): + if ( self.DictMCVal[ 'FunctionCallsNumber' ] == "yes" ): + txt = "%s = %s.getEvaluationCallsNumber()\n" % (self.variable["modelEvaluationCalls"], self.variable["model"]) + txt += "%s = %s.getGradientCallsNumber()\n" % (self.variable["modelGradientCalls"], self.variable["model"]) + txt += "%s = %s.getHessianCallsNumber()\n" % (self.variable["modelHessianCalls"], self.variable["model"]) + txt += "\n" + + txt += "# Perform the computation\n" + txt += "%s.run()\n" % self.variable["myAlgo"] + txt += "\n" + + + if ( self.DictMCVal.has_key( 'FunctionCallsNumber' ) ): + if ( self.DictMCVal[ 'FunctionCallsNumber' ] == "yes" ): + txt += "%s = %s.getEvaluationCallsNumber() - %s\n" % (self.variable["modelEvaluationCalls"], self.variable["model"], self.variable["modelEvaluationCalls"]) + txt += "%s = %s.getGradientCallsNumber() - %s\n" % (self.variable["modelGradientCalls"], self.variable["model"], self.variable["modelGradientCalls"]) + txt += "%s = %s.getHessianCallsNumber() - %s\n" % (self.variable["modelHessianCalls"], self.variable["model"], self.variable["modelHessianCalls"]) + txt += "\n" + txt += "print '%s =', %s\n" % (self.variable["modelEvaluationCalls"], self.variable["modelEvaluationCalls"]) + txt += "print '%s =', %s\n" % (self.variable["modelGradientCalls"], self.variable["modelGradientCalls"]) + txt += "print '%s =', %s\n" % (self.variable["modelHessianCalls"], self.variable["modelHessianCalls"]) + txt += "\n" + + return txt + + def Cobyla (self): + ''' + Methode Cobyla + ''' + txt = "# Optimisation par Cobyla\n" + txt += "%s = Cobyla()\n" % self.variable["myOptimizer"] + txt += "#%s = CobylaSpecificParameters()\n" % self.variable["specificParameters"] + txt += "#%s.setSpecificParameters( %s )\n" % (self.variable["myOptimizer"], self.variable["specificParameters"]) + txt += "\n" + + return txt + + def AbdoRackwitz (self): + ''' + Methode AbdoRackwitz + ''' + txt = "# Optimisation par AbdoRackwitz\n" + txt += "%s = AbdoRackwitz()\n" % self.variable["myOptimizer"] + txt += "#%s = AbdoRackwitzSpecificParameters()\n" % self.variable["specificParameters"] + txt += "#%s.setSpecificParameters( %s )\n" % (self.variable["myOptimizer"], self.variable["specificParameters"]) + txt += "\n" + return txt + def Beta (self, loi, i, collection): ''' Definition de la loi Beta diff -urN eficas-1.15.0.orig/generator/OpenturnsXML.py eficas-1.15.0/generator/OpenturnsXML.py --- eficas-1.15.0.orig/generator/OpenturnsXML.py 2008-12-08 14:54:08.000000000 +0100 +++ eficas-1.15.0/generator/OpenturnsXML.py 2009-01-12 15:59:07.000000000 +0100 @@ -5,6 +5,8 @@ """ Ce module contient le generateur XML pour Openturns """ +import sys +print sys.path import openturns # Dictionnaires de conversion des valeurs lues dans EFICAS @@ -60,10 +62,9 @@ ''' Generation du fichier XML ''' - def __init__ (self, appli, DictMCVal, ListeVariables, DictLois ) : + def __init__ (self, appli, DictMCVal, DictVariables ) : self.DictMCVal = DictMCVal - self.ListeVariables = ListeVariables - self.DictLois = DictLois + self.DictVariables = DictVariables self.appli = appli def CreeXML (self) : @@ -90,16 +91,16 @@ Ecrit la liste des variables ''' varList = openturns.WrapperDataVariableList() - for dictVar in self.ListeVariables : - varList.add( self.Variable( dictVar ) ) + for var in self.DictVariables.keys() : + varList.add( self.Variable( var, self.DictVariables[var] ) ) return varList - def Variable (self, dictVar) : + def Variable (self, var, dictVar) : ''' Ecrit le parametrage d une variable ''' variable = openturns.WrapperDataVariable() - variable.id_ = dictVar[ 'Name' ] + variable.id_ = var if dictVar[ 'Type' ] in VariableTypeByName.keys() : variable.type_ = VariableTypeByName[ dictVar[ 'Type' ] ] if dictVar.has_key('Comment') : variable.comment_ = dictVar[ 'Comment' ] @@ -158,7 +159,7 @@ if dictFile.has_key('Path') : fich.path_ = dictFile[ 'Path' ] if dictFile.has_key('Subst') : import string - fich.subst_ = string.join( dictFile[ 'Name' ], ',' ) + fich.subst_ = string.join( dictFile[ 'Subst' ], ',' ) return fich def Parameters (self) : diff -urN eficas-1.15.0.orig/generator/generator_openturns_study.py eficas-1.15.0/generator/generator_openturns_study.py --- eficas-1.15.0.orig/generator/generator_openturns_study.py 2008-12-08 14:54:08.000000000 +0100 +++ eficas-1.15.0/generator/generator_openturns_study.py 2009-01-12 15:59:08.000000000 +0100 @@ -87,22 +87,24 @@ self.dictTempo[obj.nom]=obj.valeur return s - def generMCFACT(self,obj): - # Il n est pas possible d utiliser obj.valeur qui n est pas - # a jour pour les nouvelles variables ou les modifications - if obj.nom in ( "Variables", "Files", ) : - self.TraiteMCSIMP=0 - self.dictTempo={} - s=PythonGenerator.generMCFACT(self,obj) - if obj.nom in ( "Variables", ) : - self.listeVariables.append(self.dictTempo) - self.dictTempo={} - else : - self.listeFichiers.append(self.dictTempo) - self.TraiteMCSIMP=1 - return s +# def generMCFACT(self,obj): +# # Il n est pas possible d utiliser obj.valeur qui n est pas +# # a jour pour les nouvelles variables ou les modifications +# if obj.nom in ( "Variables", "Files", ) : +# self.TraiteMCSIMP=0 +# self.dictTempo={} +# s=PythonGenerator.generMCFACT(self,obj) +# if obj.nom in ( "Variables", ) : +# self.listeVariables.append(self.dictTempo) +# self.dictTempo={} +# else : +# self.listeFichiers.append(self.dictTempo) +# self.TraiteMCSIMP=1 +# return s def generETAPE(self,obj): + print "IDM: generETAPE dans generator_openturns_study.py" + print "IDM: obj.nom=", obj.nom if obj.nom in ( "DISTRIBUTION", ) : self.TraiteMCSIMP=0 self.dictTempo={} @@ -113,8 +115,22 @@ self.TraiteMCSIMP=1 return s + def generPROC_ETAPE(self,obj): + print "IDM: generPROC_ETAPE dans generator_openturns_study.py" + print "IDM: obj.nom=", obj.nom + if obj.nom in ( "VARIABLE", ) : + self.TraiteMCSIMP=0 + self.dictTempo={} + s=PythonGenerator.generPROC_ETAPE(self,obj) + if obj.nom in ( "VARIABLE", ) : + self.listeVariables.append(self.dictTempo) + self.dictTempo={} + self.TraiteMCSIMP=1 + return s + def genereSTD(self): print "IDM: genereSTD dans generator_openturns_study.py" + print "IDM: self.listeVariables=", self.listeVariables MonBaseGenerateur=Generateur(self.appli,self.dictMCVal, self.listeVariables, self.dictMCLois) MonGenerateur=MonBaseGenerateur.getSTDGenerateur() #try : diff -urN eficas-1.15.0.orig/generator/generator_openturns_wrapper.py eficas-1.15.0/generator/generator_openturns_wrapper.py --- eficas-1.15.0.orig/generator/generator_openturns_wrapper.py 2008-12-08 14:54:08.000000000 +0100 +++ eficas-1.15.0/generator/generator_openturns_wrapper.py 2009-01-12 15:59:08.000000000 +0100 @@ -57,11 +57,11 @@ def initDico(self): self.dictMCVal={} - self.listeVariables=[] + self.dictVariables={} self.listeFichiers=[] - self.dictMCLois={} self.dictTempo={} - self.TraiteMCSIMP=1 + self.traiteMCSIMP=1 + self.numOrdre=0 self.texteSTD="""#!/usr/bin/env python import sys print "Invalid file. Check build process." @@ -83,25 +83,39 @@ Remplit le dictionnaire des MCSIMP si nous ne sommes ni dans une loi, ni dans une variable """ s=PythonGenerator.generMCSIMP(self,obj) - if self.TraiteMCSIMP == 1 : + if self.traiteMCSIMP == 1 : self.dictMCVal[obj.nom]=obj.val else : self.dictTempo[obj.nom]=obj.valeur return s + def generETAPE(self,obj): + #print "generETAPE" , obj.nom + if obj.nom == "VARIABLE" : + self.traiteMCSIMP=0 + self.dictTempo={} + s=PythonGenerator.generETAPE(self,obj) + if obj.nom == "VARIABLE" : + self.dictTempo["numOrdre"]=self.numOrdre + self.numOrdre = self.numOrdre +1 + if obj.sd == None : + self.dictVariables["SansNom"]=self.dictTempo + else : + self.dictVariables[obj.sd.nom]=self.dictTempo + self.dictTempo={} + self.traiteMCSIMP=1 + return s + def generMCFACT(self,obj): # Il n est pas possible d utiliser obj.valeur qui n est pas # a jour pour les nouvelles variables ou les modifications - if obj.nom in ( "Variables", "Files", ) : - self.TraiteMCSIMP=0 + #print "generMCFACT" , obj.nom + if obj.nom in ( "Files", ) : + self.traiteMCSIMP=0 self.dictTempo={} s=PythonGenerator.generMCFACT(self,obj) - if obj.nom in ( "Variables", ) : - self.listeVariables.append(self.dictTempo) - self.dictTempo={} - else : - self.listeFichiers.append(self.dictTempo) - self.TraiteMCSIMP=1 + self.listeFichiers.append(self.dictTempo) + self.traiteMCSIMP=1 return s def genereXML(self): @@ -109,7 +123,8 @@ #print "appli.CONFIGURATION=",self.appli.CONFIGURATION.__dict__ if self.listeFichiers != [] : self.dictMCVal["Files"]=self.listeFichiers - MonBaseGenerateur=Generateur(self.appli,self.dictMCVal, self.listeVariables, self.dictMCLois) + print "dictMCVal", self.dictMCVal, "dictVariables", self.dictVariables + MonBaseGenerateur=Generateur(self.appli,self.dictMCVal, [], {} ,self.dictVariables) MonGenerateur=MonBaseGenerateur.getXMLGenerateur() #try : if 1== 1 :