from .generator_python import PythonGenerator
from .textePersalys import headerScriptPersalys, fonctionPersalys, etudeScript, codePersalys
from .textePersalys import mainPersalys, inputHeaderPersalys, outputHeaderPersalys
-from .textePersalys import getResultCall
+from .textePersalys import getResultCall,getResultCallAvoidPersalysBug
from .textePersalys import centralTendencyTaylor, resultTaylor
from .textePersalys import optionalResultTaylor, optionalPrintResultTaylor
from .textePersalys import centralTendencyMC, resultMC
return '@ '+obj.nom+' @,'
def analyseIncertitude(self) :
+ from functools import reduce as reduce
self.txtScriptPersalys = ''
etapeIncertitude=self.jdc.getEtapesByName('ExpressionIncertitude')
'valeur minimale':'vMin',
'valeur maximale':'vMax'
}
-
+
+ index=0;
for mc in self.lesVariablesOutput :
+ nomShortVariableOutputList=''
nomFctAggPyList=''
nomOutputList=''
nomVar = mc.getChildOrChildInBloc('VariablePhysique').valeur
nomOutputList += nomOutput + ', '
self.chaineDesVariablesOutputEncodee+=nomOutput+ ', '
variablesOutputDesc = nomFctAgg+'('+nomVarPostraite+')'
- # tmpGetResultCall = getResultCall.format(
- # variableOutput = nomOutput,
- # postProcessedVar = nomVarPostraite,
- # fonctionAggregation = nomFctAggPy
- # )
+ nomShortVariableOutputList+='a'+str(index)+', ' # Avoid a Persalys Bug
+ index+=1
self.txtOutputVariableInitList += self.indent1 + nomOutput + " = persalys.Output('"+ nomVar+' (Agg: '+nomFctAgg+')' + "', '"+variablesOutputDesc + "')\n"
- tmpGetResultCall = getResultCall.format(
+ # tmpGetResultCall = getResultCall.format(
+ tmpGetResultCall = getResultCallAvoidPersalysBug.format( # Avoid a Persalys Bug
variableOutputList = nomOutputList[0:-2],
nomVarPostraite = nomVarPostraite,
- fonctionAggregationList = nomFctAggPyList[0:-2]
+ fonctionAggregationList = nomFctAggPyList[0:-2],
+ shortVariableOutputList = nomShortVariableOutputList # Avoid a Persalys Bug
)
self.txtGetAllResults += tmpGetResultCall
self.chaineDesVariablesOutputEncodee=self.chaineDesVariablesOutputEncodee[0:-2]
+ self.chaineDesShortVariablesOutput = reduce(lambda x,y:x+y,
+ [ "a"+str(i)+', ' for i in range(index)])
-
sectionExecution = etapeIncertitude.getChildOrChildInBloc('Execution')[0]
self.NbDeBranches = sectionExecution.getChildOrChildInBloc('NbDeBranches').valeur
if sectionExecution.getChildOrChildInBloc('ExecutionMode') != None :
currentFile = self.fichierUQModule,
chaineDesVariablesInput = self.chaineDesVariablesInput,
getAllResults = self.txtGetAllResults,
- chaineDesVariablesOutput = self.chaineDesVariablesOutputEncodee
+ #chaineDesVariablesOutput = self.chaineDesVariablesOutputEncodee
+ chaineDesVariablesOutput = self.chaineDesShortVariablesOutput # Avoid a Persalys Bug
)
self.txtScriptPersalys += codePersalys.format(
fonctionPersalys =txtFonctionPersalys
# /home/C65845/VIMMP/Banc_integration.newer_odysee/environment/bin/python3 /home/C65845/VIMMP/Banc_integration.newer_odysee/environment/bin/ib-run --cocagne-neutro-solver SPN --cocagne-thermo-solver THERMOMI/TRMIC -- /home/C65845/VIMMP/Banc_integration.newer_odysee/integration_bench/tests/control_rod_ejection_small_core_cathare3_cocagne.comm /home/C65845/VIMMP/Banc_integration.newer_odysee/integration_bench/tests/control_rod_ejection_small_core_cathare3_cocagne_spn_thermomi-trmic_serial
-# getResultCall=""" {variableOutputList}, = study.get_result_from_csv( '{nomVarPostraite}', [{fonctionAggregationList}] )
-# """
-
getResultCall=""" {variableOutputList}, = study.get_result_from_csv( '{nomVarPostraite}', [{fonctionAggregationList}] )
print( '{nomVarPostraite}: ({variableOutputList})',{variableOutputList})
"""
+getResultCallAvoidPersalysBug=""" {variableOutputList}, = study.get_result_from_csv( '{nomVarPostraite}', [{fonctionAggregationList}] )
+
+ print( '{nomVarPostraite}: ({variableOutputList})',{variableOutputList})
+
+ #Contournement Bug Persalys sur la longueur de la chaine retour
+ {shortVariableOutputList} = {variableOutputList}
+
+"""
+
#-------------------------
# fonctionPersalys
# ------------------------
study.run_case()
{getAllResults}
-
return {chaineDesVariablesOutput}
"""