From: PASCALE NOYRET Date: Mon, 27 Jun 2022 08:35:37 +0000 (+0200) Subject: push fin du traitement MC incertain avant merge avec version d eric. le generator... X-Git-Tag: merge_uncertainty_odysee_1210~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f19677a1212faecacd68d6c059f0ec9390f6e30a;p=tools%2Feficas.git push fin du traitement MC incertain avant merge avec version d eric. le generator-UQ ne fonctionne plus : la variable NomDeLaVariable est devenu ModelVariable --- diff --git a/Ihm/I_MCSIMP.py b/Ihm/I_MCSIMP.py index c224e544..7a796d81 100644 --- a/Ihm/I_MCSIMP.py +++ b/Ihm/I_MCSIMP.py @@ -902,6 +902,9 @@ class MCSIMP(I_OBJECT.OBJECT): if etapeIncertitude == [] : self.jdc.editor.tree.racine.appendChild('ExpressionIncertitude', 'last') etapeIncertitude=self.jdc.getEtapesByName('ExpressionIncertitude') + # Ou la la, que c est generique + # ajouter un op_construction + etapeIncertitude[0].buildSd() etapeIncertitude=etapeIncertitude[0] incertitudeInput = etapeIncertitude.getChildOrChildInBloc('Input') nodeVariableProbabiliste=incertitudeInput.node.appendChild('VariableProbabiliste', 'first') diff --git a/InterfaceQT4/feuille.py b/InterfaceQT4/feuille.py index 4d075a37..3ddc3225 100644 --- a/InterfaceQT4/feuille.py +++ b/InterfaceQT4/feuille.py @@ -55,9 +55,9 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): self.setupUi(self) self.prendLeFocus=0 - maPolice= QFont("Times", 10) - self.setFont(maPolice) - self.setFocusPolicy(Qt.StrongFocus) + #maPolice= QFont("Times", 10) + #self.setFont(maPolice) + #self.setFocusPolicy(Qt.StrongFocus) self.parentQt=parentQt self.editor=self.node.editor @@ -82,7 +82,7 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): self.setZoneInfo() self.setUnite() #inhibition incertitude - #if hasattr(self,'checkBoxUQ') : self.checkBoxUQ.close() + self.inhibeSignal = False self.setUQ() @@ -107,7 +107,14 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): self.checkBoxUQ.toggled.connect(self.setEnabledUQ) def setEnabledUQ(self) : - if self.checkBoxUQ.isChecked() : self.objSimp.lieVariableUQ() + if self.inhibeSignal : self.inhibeSignal=False; return + if self.checkBoxUQ.isChecked() : + if self.objSimp.etape.nature == 'OPERATEUR' and not(self.objSimp.etape.sd): + QMessageBox.warning( self,tr('Attention'),tr('Il faut d abord nommer '+self.objSimp.etape.nom + ' avant de pourvoir choisir des variables incertaines')) + self.inhibeSignal = True + self.checkBoxUQ.setCheckState(False) + return + self.objSimp.lieVariableUQ() else : ret = self.objSimp.delieVariableUQ() if not ret : QMessageBox.warning( self,tr( "Variable associée non trouvée "),tr( "prevenez la maintenance")) diff --git a/Noyau/N_JDC_CATA.py b/Noyau/N_JDC_CATA.py index 3f6fcafa..2c37bb8c 100644 --- a/Noyau/N_JDC_CATA.py +++ b/Noyau/N_JDC_CATA.py @@ -51,7 +51,7 @@ class JDC_CATA(N_ENTITE.ENTITE): def __init__(self, code='', execmodul=None, regles=(), niveaux=(),fichierSource=None, fr='', ang ='', **args): """ on se laisse la possibilite d initier fichierSource avec autre chose que le nom du fichier - au cas ou ... pour pouvoir changer le nom du 'sous code' implementer (cf readercata) + au cas ou ... pour pouvoir changer le nom du 'sous code' implemente (cf readercata) """ self.code = code self.fr = fr diff --git a/Noyau/N_SIMP.py b/Noyau/N_SIMP.py index b61b0a11..5c960837 100644 --- a/Noyau/N_SIMP.py +++ b/Noyau/N_SIMP.py @@ -155,12 +155,20 @@ class SIMP(N_ENTITE.ENTITE): def changeInto(self, listeDesIntos): self.into=listeDesIntos + def changeIntoSelonValeurs(self, mcRecepteur): + mcRecepteur.changeInto(self.valeurs) + def addInto(self, nvlInto): + if self.into == None : self.into=[] + if nvlInto in self.into : return self.into.append(nvlInto) def changeStatut(self, nvlStatut): self.statut=nvlStatut + def changeSiValide(self, nvlFonction): + self.siValide=nvlFonction + def verifCata(self): """ Cette methode sert à valider les attributs de l'objet de définition diff --git a/ReacteurNumerique/cata_RN_UQ.py b/ReacteurNumerique/cata_RN_UQ.py index e950f9e5..7a3a2159 100644 --- a/ReacteurNumerique/cata_RN_UQ.py +++ b/ReacteurNumerique/cata_RN_UQ.py @@ -23,17 +23,15 @@ dictUQ = {'initial_power' : ({'Uniform' : {}}, {'TruncatedNormal' : {}}, {'UserD # modifier la partie Accas pour garder une reference a l objet nomme } -#listeDesSortiesPossibles = ("Average_mass_flux", "Boiling_power_fraction", "Boron_concentration", "Enthalpy", "Fuel_power_fraction", "Fuel_temperature", "Kinetic_reactivity", "Liquid_power", "Mass_flux", "Mass_fraction", "Mass_title", "Mixture_density", "Mixture_specific_enthalpy", "Mixture_temperature", "Neutronic_power", "Outlet_pressure", "Pollutant_concentration", "Pressure ", "Rowlands_fuel_effective_temp", "Thermal_power", "Water_density", "Water_temperature", "Power_level" ) -listeDesSortiesNeutro = ( "Boron_concentration", "Kinetic_reactivity", "Neutronic_power", ) -listeDesSortiesTherm = ("Average_mass_flux", "Boiling_power_fraction", "Enthalpy", "Fuel_temperature", "Liquid_power", "Mass_flux", "Mass_fraction", "Mass_title", "Mixture_density", "Mixture_specific_enthalpy", "Mixture_temperature", "Outlet_pressure", "Pollutant_concentration", "Pressure ", "Rowlands_fuel_effective_temp", "Thermal_power", "Water_density", "Water_temperature", ) +listeDesSortiesNeutro = ( "Boron concentration", "Kinetic reactivity", "Neutronic power", ) +listeDesSortiesThermo = ("Average mass flux", "Boiling power fraction", "Enthalpy", "Fuel temperature", "Liquid power", "Mass flux", "Mass fraction", "Mass title", "Mixture density", "Mixture specific enthalpy", "Mixture temperature", "Outlet pressure", "Pollutant concentration", "Pressure ", "Rowlands fuel effective temp", "Thermal power", "Water density", "Water temperature", ) -dicoDesSortiesPossibles={'Neutro':listeDesSortiesNeutro,'Thermo':listeDesSortiesTherm} -#dicoDesSortiesPossibles={'Neutro':listeDesSortiesNeutro} +dicoDesSortiesPossibles={'Neutronics':listeDesSortiesNeutro,'Thermalhydraulics':listeDesSortiesThermo} +#dicoDesSortiesPossibles={'Thermalhydraulics':listeDesSortiesThermo} from cata_UQ import creeOperExpressionIncertitude ExpressionIncertitude=creeOperExpressionIncertitude(dictUQ, dicoDesSortiesPossibles) - #autonome=1 autonome=0 if autonome : diff --git a/ReacteurNumerique/cata_UQ.py b/ReacteurNumerique/cata_UQ.py index ffcec4e3..46e81ef3 100644 --- a/ReacteurNumerique/cata_UQ.py +++ b/ReacteurNumerique/cata_UQ.py @@ -12,36 +12,14 @@ from Noyau.N_VALIDATOR import Valid #TODO --> si UserDefined et Uranie alors UserDefined -#def creeLienVPVD(monMC): -# if monMC.valeur == () or monMC.valeur == None : return -# print (monMC) - # a faire class infFrereMC(Valid): def __init__(self,nomMCFrere): self.nomMCFrere = nomMCFrere # -listeLoiDistribution= ( #"Beta", - #"Exponential", - #"Gamma", - #"Geometric", - #"Gumbel", - #"Histogram", - #"Laplace", - #"Logistic", - #"LogNormal", - #"MultiNomial", - #"NonCentralStudent", - #"Normal", - #"Poisson", - #"Rayleigh", - #"Student", - #"Triangular", - "TruncatedNormal", - "Uniform", - "UserDefined", - #"Weibull", - ), +#listeLoiDistribution= ( #"Beta", #"Exponential", #"Gamma", #"Geometric", #"Gumbel", #"Histogram", #"Laplace", #"Logistic", #"LogNormal", #"MultiNomial", + #"NonCentralStudent", #"Normal", #"Poisson", #"Rayleigh", #"Student", #"Triangular", "TruncatedNormal", "Uniform", "UserDefined", + #"Weibull",), ##==== ## Definition des parametres selon le type de la loi @@ -671,44 +649,6 @@ def creeUserDefined (): # # # -##================================ -## Definition du modele physique -##================================ -# -# -#Deterministic_variable = OPER ( nom = "Deterministic_variable", -# sd_prod = variable, -# op = None, -# fr = "Variable deterministe", -# ang = "Deterministic variable", -# UIinfo={"groupes":("UQ",)}, -# -# N = SIMP( statut = 'o', -# typ = "TXM", -# fr = "Nom", -# ang = "Name", -# ), -# -# T = SIMP( statut = 'o', -# defaut = "in", -# into = ( "in" , "out", ), -# typ = "TXM", -# fr = "Type", -# ang = "Type", -# ), -# -# R = SIMP( statut = 'o', -# defaut = 0, -# typ = "I", -# fr = "Rang", -# ang = "Rank", -# ), -# -#) # Fin OPER DETERMINISTICVARIABLE -# -# -# -# #Correlation = PROC ( nom = 'Correlation', # op = None, # docu = "", @@ -745,265 +685,6 @@ def creeUserDefined (): # # # -##================================ -## Definition de l'etude -##================================ -# -## Nota : les variables de type PROC doivent etre en majuscules ! -#Criteria = PROC ( nom = "Criteria", -# op = None, -# docu = "", -# fr = "Critère de l'étude d'incertitudes", -# ang = "Uncertainty study criteria", -# UIinfo={"groupes":("UQ",)}, -# -# -# -# Type = SIMP( statut = "o", -# typ = "TXM", -# into = ( "Min/Max", "Central Uncertainty", "Threshold Exceedence" ), -# fr = "Type du critère", -# ang = "Criteria type", -# ), -# -# -# -# -# -# -# -# MinMax = BLOC( condition = " Type in ( 'Min/Max', ) ", -# -# Method = SIMP( statut = "o", -# typ = "TXM", -# into = ( "Experiment Plane", "Random Sampling" ), -# fr = "Methode", -# ang = "Method", -# ), -# # UC 3.1.1 -# ExperimentPlaneSettings = BLOC( condition = " Method in ( 'Experiment Plane', ) ", -# -# ExperimentPlane = SIMP( statut = "o", -# typ = "TXM", -# into = ( "Axial", "Factorial", "Composite", ), -# fr = "Type du plan d'expérience", -# ang = "Experiment plane type", -# ), -# -# Levels = SIMP( statut = "o", -# typ = "R", -# val_min = 0.0, -# max = '**', -# fr = "Liste de niveaux dans chaque direction", -# ang = "Levels in each direction", -# ), -# -# # Scaled Vector -# UnitPerDimension = SIMP( statut = "o", -# typ = "R", -# max = '**', -# fr = "Unité par dimension (autant que de variables declarées)", -# ang = "Units per dimension (as much as declared variables)", -# ), -# -# # Translation Vector -# Center = SIMP( statut = "o", -# typ = "R", -# max = '**', -# fr = "Centre du plan d'expérience", -# ang = "Experiment plan center", -# ), -# -# ), # Fin BLOC ExperimentPlaneSettings -# -# -# -# RandomSamplingSettings = BLOC( condition = " Method in ( 'Random Sampling', ) ", -# -# SimulationsNumber = SIMP( statut = "o", -# typ = "I", -# val_min = 1, -# fr = "Nombre de points", -# ang = "Points number", -# ), -# -# ), # Fin BLOC RandomSamplingSettings -# -# Result = SIMP( statut = "o", -# typ = "TXM", -# into = ( "Min/Max", ), -# defaut = "Min/Max", -# fr = "Le minimum et le maximum de la variable d'intérêt", -# ang = "The min and max values", -# ), -# -# -# ), # Fin BLOC MinMax -# -# -# -# -# CentralUncertainty = BLOC( condition = " Type in ( 'Central Uncertainty', ) ", -# -# Method = SIMP( statut = "o", -# typ = "TXM", -# into = ( "Taylor Variance Decomposition", "Random Sampling" ), -# fr = "Methode", -# ang = "Method", -# ), -# -# # UC 3.2. -# TaylorVarianceDecompositionSettings = BLOC( condition = " Method in ( 'Taylor Variance Decomposition', ) ", -# -# Result = FACT ( statut = "o", -# min = 1, -# max = "**", -# -# MeanFirstOrder = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Moyenne au premier ordre", -# ang = "MeanFirstOrder", -# ), -# -# StandardDeviationFirstOrder = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Ecart-type au premier ordre", -# ang = "StandardDeviationFirstOrder", -# ), -# -# MeanSecondOrder = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'no', -# max = 1, -# fr = "Moyenne au second ordre", -# ang = "MeanSecondOrder", -# ), -# -# ImportanceFactor = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Facteur d'importance pour variable de sortie scalaire", -# ang = "ImportanceFactor", -# ), -# ImportanceFactorSettings = BLOC( condition = " ImportanceFactor in ( 'yes', ) ", -# -# ImportanceFactorDrawingFilename = SIMP( statut = "o", -# typ = "TXM", -# max = 1, -# fr = "Nom du fichier graphique des facteurs d'importance", -# ang = "Importance Factor Drawing Filename", -# ), -# -# -# ), # Fin BLOC ImportanceFactorSettings -# -# ), # Fin FACT Result -# -# ), # Fin BLOC TaylorVarianceDecompositionSettings -# -# -# -# RandomSamplingSettings = BLOC( condition = " Method in ( 'Random Sampling', ) ", -# -# SimulationsNumber = SIMP( statut = "o", -# typ = "I", -# val_min = 1, -# fr = "Nombre de points", -# ang = "Points number", -# ), -# -# Result = FACT ( statut = "o", -# min = 1, -# max = "**", -# -# EmpiricalMean = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Moyenne empirique", -# ang = "Empirical mean", -# ), -# -# EmpiricalStandardDeviation = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Ecart-type empirique", -# ang = "Empirical standard deviation", -# ), -# -# EmpiricalQuantile = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Quantile empirique", -# ang = "Empirical quantile", -# ), -# -# EmpiricalQuantileSettings = BLOC( condition = " EmpiricalQuantile in ( 'yes', ) ", -# -# EmpiricalQuantile_Order = SIMP( statut = "o", -# typ = 'R', -# defaut = 0.95, -# max = 1, -# val_min = 0.0, -# val_max = 1.0, -# fr = "Ordre du quantile empirique", -# ang = "Empirical quantile order", -# ), -# -# ), # Fin BLOC EmpiricalQuantileSettings -# -# CorrelationAnalysis = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Correlations analysees", -# ang = "Analysed correlations", -# ), -# -# KernelSmoothing = SIMP( statut = "o", -# typ = 'TXM', -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# max = 1, -# fr = "Kernel smoothing de l'echantillon", -# ang = "Kernel smoothing of the sample", -# ), -# -# KernelSmoothingSettings = BLOC( condition = " KernelSmoothing in ( 'yes', ) ", -# -# KernelSmoothingDrawingFilename = SIMP( statut = "o", -# typ = "TXM", -# max = 1, -# fr = "Nom du fichier graphique de la reconstruction a noyau", -# ang = "Kernel Smoothing Drawing Filename", -# ), -# -# -# ), # Fin BLOC KernelSmoothingSettings -# -# ), # Fin FACT Result -# -# ), # Fin BLOC RandomSamplingSettings -# -# ), # Fin BLOC CentralUncertainty -# -# -# # # ThresholdExceedence = BLOC( condition = " Type in ( 'Threshold Exceedence', ) ", # @@ -1510,68 +1191,6 @@ def creeUserDefined (): #) # Fin PROC CRITERIA # # -## -------------------------------------------------- -## Niveau de Journalisation -## -------------------------------------------------- -# -#Journalisation_Code = PROC ( nom = "Journalisation_Code", -# docu = "", -# UIinfo={"groupes":("UQ",)}, -# -# DebugMessages = SIMP( statut = "o", -# typ = "TXM", -# into = ( 'yes', 'no' ), -# defaut = 'no', -# fr = "Affichage du niveau de debug de la bibliotheque Open TURNS", -# ang = "Open TURNS library debug level print", -# ), -# -# WrapperMessages = SIMP( statut = "o", -# typ = "TXM", -# into = ( 'yes', 'no' ), -# defaut = 'no', -# fr = "Affichage du niveau de wrapper de la bibliotheque Open TURNS", -# ang = "Open TURNS library debug level print", -# ), -# -# UserMessages = SIMP( statut = "o", -# typ = "TXM", -# into = ( 'yes', 'no' ), -# defaut = 'no', -# fr = "Affichage du niveau de user de la bibliotheque Open TURNS", -# ang = "Open TURNS library user level print", -# ), -# -# InfoMessages = SIMP( statut = "o", -# typ = "TXM", -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# fr = "Affichage du niveau de info de la bibliotheque Open TURNS", -# ang = "Open TURNS library info level print", -# ), -# -# WarningMessages = SIMP( statut = "o", -# typ = "TXM", -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# fr = "Affichage du niveau de warning de la bibliotheque Open TURNS", -# ang = "Open TURNS library warning level print", -# ), -# -# ErrorMessages = SIMP( statut = "o", -# typ = "TXM", -# into = ( 'yes', 'no' ), -# defaut = 'yes', -# fr = "Affichage du niveau de error de la bibliotheque Open TURNS", -# ang = "Open TURNS library error level print", -# ), -# -#) # Fin Niveaux_Log_Code -# -# -# -# -# def affineDistribution(monDicoVarDeter,var,loi): nomLoi=list(monDicoVarDeter[var].keys())[0] @@ -1602,42 +1221,66 @@ def creeDistributionsSelonVariable(monDicoVarDeter): nomBloc = 'b_Model_Variable_' + var+'_'+nomLoi dicoDistribution[nomBloc]=bloc lesBlocs[nomBlocVar]= BLOC(condition=laCondition, Distribution = distribution, **dicoDistribution) - print (lesBlocs) return lesBlocs +def definitIntoOuput(objExpression, contexte): + # protege par un gros try -) + debug=0 + if debug : print (objExpression) + jdc=objExpression.jdc + if not jdc : return + if debug : print (jdc) + monScenario=jdc.getEtapesByName('Scenario_data')[0] + if debug : print (monScenario) + mesPostPro=monScenario.getChildOrChildInBloc('post_processing') + if debug : print (mesPostPro) + if not mesPostPro : return + mesPostPro.definition.changeSiValide(changeIntoOuput) + changeIntoOuput(mesPostPro) + + +def changeIntoOuput(objPostPro): + mesPostProVal=objPostPro.valeur + contexte=objPostPro.etape.parent.g_context + for (variable,fonct) in mesPostProVal : + if fonct == 'MED' : continue + nomVar=variable.split('@')[0] + phys=variable.split('@')[1] + nomAProposer= variable+'@'+fonct + nomBloc = 'b_physique_' + phys + nomBlocVar = ('b_var_'+nomVar).replace( ' ','__') + maDef=contexte['ExpressionIncertitude'].entites['Output'].entites['VariableDeSortie'].entites[nomBloc].entites[nomBlocVar].entites['VariablePosttraiteeAssociee'] + maDef.addInto(nomAProposer) + + def creeOutput(monDicoVarSortie): intoVariable=list(monDicoVarSortie.keys()) - if len(intoVariable) == 1 : - listeDesVariablesSortiePossibles = monDicoVarSortie[list(monDicoVarSortie.keys())[0]] - output = FACT (max=1, statut ='o', - VariableDeSortie = FACT ( max='**', statut ='o', - Physique = SIMP (statut = "o", typ = "TXM",into = intoVariable,defaut=intoVariable[0]), - NomDeLaVariable = SIMP ( statut = "o", typ = "TXM", into = listeDesVariablesSortiePossibles), - FonctionDAggregation = SIMP(statut = 'o', typ= 'TXM', into = ('Max', 'Min', 'Med', 'Moy', 'Sum'),defaut=('Max'), max='**', homo='SansOrdreNiDoublon'), - Unit = SIMP ( statut = "f", typ = "TXM", fr = "Unite", ang = "Unit",), - Format = SIMP ( statut = "f", typ = "TXM", fr = "Format de sortie", ang = "format", into =['med', 'csv']), - ), - ) - return output - else : - lesBlocs={} - Physique = SIMP (statut = "o", typ = "TXM",into = intoVariable,defaut=intoVariable[0]) - for phys in intoVariable : - laCondition ="Physique == '" + phys + "'" - NomDeLaVariable = SIMP ( statut = "o", typ = "TXM", into = monDicoVarSortie[phys], ) - nomBloc = 'b_physique_' + phys - lesBlocs[nomBloc] = BLOC (condition=laCondition, NomDeLaVariable = NomDeLaVariable) - FonctionDAggregation = SIMP(statut = 'o', typ= 'TXM', into = ('Max', 'Min', 'Med', 'Moy', 'Sum'),defaut=('Max'), max='**', homo='SansOrdreNiDoublon') + lesBlocs={} + Physique = SIMP (statut = "o", typ = "TXM",into = intoVariable,defaut=intoVariable[0]) + for phys in intoVariable : + laCondition = "Physique == '" + phys + "'" + VariablePhysique = SIMP(statut = "o", typ = "TXM", into = monDicoVarSortie[phys], ) Unit = SIMP ( statut = "f", typ = "TXM", fr = "Unite", ang = "Unit",) Format = SIMP ( statut = "f", typ = "TXM", fr = "Format de sortie", ang = "format", into =['med', 'csv']) - VariableDeSortie = FACT ( max='**', statut ='o', Physique=Physique, **lesBlocs, FonctionDAggregation=FonctionDAggregation, Unit=Unit,Format=Format) - output = FACT (max=1, statut ='o', VariableDeSortie=VariableDeSortie) - return output + lesBlocsVar={} + for v in monDicoVarSortie[phys] : + VariablePosttraiteeAssociee = SIMP ( statut = "o", typ = "TXM", into=[]) + Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut="la Variable Post Traitée associée doit être présente dans la variable post_processing de Scenario_Data") + laConditionVar ="VariablePhysique == '" + v + "'" + nomBlocVar=('b_var_'+v).replace( ' ','__') + lesBlocsVar[nomBlocVar]= BLOC (condition=laConditionVar, VariablePosttraiteeAssociee=VariablePosttraiteeAssociee, Consigne=Consigne) + nomBloc = 'b_physique_' + phys + lesBlocs[nomBloc] = BLOC (condition=laCondition, VariablePhysique = VariablePhysique, **lesBlocsVar) + FonctionDAggregation = SIMP(statut = 'o', typ= 'TXM', into = ('Max', 'Min', 'Med', 'Moy', 'Sum'), + defaut=('Max'), max='**', homo='SansOrdreNiDoublon') + VariableDeSortie = FACT ( max='**', statut ='o', Physique=Physique, **lesBlocs, FonctionDAggregation=FonctionDAggregation, Unit=Unit,Format=Format) + output = FACT (max=1, statut ='o', VariableDeSortie=VariableDeSortie) + return output def creeOperExpressionIncertitude(monDicoVarDeter, monDicoVarSortie): listeDesVariablesPossibles = list(monDicoVarDeter.keys()) - monOutput = creeOutput(monDicoVarSortie) + #monOutput = creeOutput(monDicoVarSortie) objectName = SIMP ( statut = "f", typ = 'TXM', into=[], fenetreIhm='menuDeroulant', homo='constant' ) # on ne met pas [] pour la projection XSD, intoXML=? modelVariable = SIMP ( statut = "o", typ = ( 'TXM'), @@ -1647,20 +1290,20 @@ def creeOperExpressionIncertitude(monDicoVarDeter, monDicoVarSortie): fenetreIhm='menuDeroulant', homo='constant', ) - laConsigne = SIMP(statut="o", homo="information", typ="TXM", defaut=' ') + Consigne = SIMP(statut="o", homo="information", typ="TXM", defaut=' ') MCPath = SIMP(statut='d', typ='TXM', defaut=(), max='**', min=0,) blocs=creeDistributionsSelonVariable(monDicoVarDeter) # Attention # l ordre des motclefs en 3.7 a l air de dépendre de l ordre de creation des objets # et non d un dict ordonné. on retombe toujours sur ce pb - return PROC ( nom = "ExpressionIncertitude", UIinfo={"groupes":("CACHE",)}, + return PROC ( nom = "ExpressionIncertitude", UIinfo={"groupes":("CACHE",)}, op_init=definitIntoOuput, Input = FACT( max=1, statut ='o', VariableProbabiliste = FACT ( max='**', statut ='cache', fr = "Variable probabiliste", ang = "Probabilistic variable", ObjectName = objectName, ModelVariable = modelVariable, - Consigne = laConsigne, + Consigne = Consigne, MCPath = MCPath, **blocs ), @@ -1740,7 +1383,7 @@ def creeOperExpressionIncertitude(monDicoVarDeter, monDicoVarSortie): Methode = SIMP( statut = "o", typ = "TXM", max=1, into = ('SRS', 'Sobol'), defaut='Sobol'), ), # fin UraniePropagation ), # fin Propagation - Output=monOutput, + Output=creeOutput(monDicoVarSortie), Execution = FACT (max=1, statut ='o', bloc_OT = BLOC (condition = 'UncertaintyTool == "OpenTurns"', ExecutionMode = SIMP ( statut = "o", typ = "TXM", into = ['desktop', 'cluster']), diff --git a/generator/generator_UQ.py b/generator/generator_UQ.py index d030c460..2e5861de 100644 --- a/generator/generator_UQ.py +++ b/generator/generator_UQ.py @@ -120,6 +120,8 @@ class UQGenerator(PythonGenerator): # DU coup qu est ce que xxx def generMCSIMP(self,obj) : + # inutile tant que FACT et BLOC ne sont pas surcharges + if self.nom=='Consigne' : return if not self.inGenerUQ : return PythonGenerator.generMCSIMP(self,obj) if not obj in self.mcIncertains : return PythonGenerator.generMCSIMP(self,obj) else : diff --git a/generator/generator_python.py b/generator/generator_python.py index e48832cb..7d27406d 100644 --- a/generator/generator_python.py +++ b/generator/generator_python.py @@ -512,7 +512,7 @@ class PythonGenerator(object): data[0]=v.nom+'='+data[0] else: data=v.nom+'='+data - l.append(data) + if v.nom != 'Consigne' : l.append(data) return l