self.txtGetAllResults = ""
#TODO? from cata_UQ import FonctionDAggregationDict
fctAggPy={
- 'valeur à t=O':'vIninialTime',
- 'valeur à mi-temps':'vHalfTtime',
+ 'valeur à t=O':'vInitialTime',
+ 'valeur à mi-temps':'vHalfTime',
'valeur à t final':'vFinalTime',
- 'valeur moyenne':'mean',
- 'valeur cumulée':'sum',
- 'valeur minimale':'min',
- 'valeur maximale':'max'
+ 'valeur moyenne':'vMean',
+ 'valeur cumulée':'vSum',
+ 'valeur minimale':'vMin',
+ 'valeur maximale':'vMax'
}
for mc in self.lesVariablesOutput :
+ nomFctAggPyList=''
+ nomOutputList=''
nomVar = mc.getChildOrChildInBloc('VariablePhysique').valeur
nomVarEncode = nomVar.replace(' ','__')
nomVarPostraite = mc.getChildOrChildInBloc('VariablePosttraiteeAssociee').valeur
nomFctAggList = mc.getChildOrChildInBloc('FonctionDAggregation').valeur
for nomFctAgg in nomFctAggList:
nomFctAggPy = fctAggPy[nomFctAgg]
+ nomFctAggPyList += nomFctAggPy + ', '
nomOutput=nomVarEncode+'_'+nomFctAggPy
+ nomOutputList += nomOutput + ', '
self.chaineDesVariablesOutputEncodee+=nomOutput+ ', '
variablesOutputDesc = nomFctAgg+'('+nomVarPostraite+')'
- tmpGetResultCall = getResultCall.format(
- variableOutput = nomOutput,
- variablePostraitee = nomVarPostraite,
- fonctionAggregation = nomFctAggPy
- )
- self.txtGetAllResults += tmpGetResultCall
+ # tmpGetResultCall = getResultCall.format(
+ # variableOutput = nomOutput,
+ # postProcessedVar = nomVarPostraite,
+ # fonctionAggregation = nomFctAggPy
+ # )
self.txtOutputVariableInitList += self.indent1 + nomOutput + " = persalys.Output('"+ nomVar+' (Agg: '+nomFctAgg+')' + "', '"+variablesOutputDesc + "')\n"
+ tmpGetResultCall = getResultCall.format(
+ variableOutputList = nomOutputList[0:-2],
+ nomVarPostraite = nomVarPostraite,
+ fonctionAggregationList = nomFctAggPyList[0:-2]
+ )
+ self.txtGetAllResults += tmpGetResultCall
+
self.chaineDesVariablesOutputEncodee=self.chaineDesVariablesOutputEncodee[0:-2]
-
+
+
sectionExecution = etapeIncertitude.getChildOrChildInBloc('Execution')[0]
self.ExecutionMode = sectionExecution.getChildOrChildInBloc('ExecutionMode').valeur
self.NbOfProcs = sectionExecution.getChildOrChildInBloc('NbOfProcs').valeur
inFiles.append(os.path.join(os.getcwd(),pyFile))
scriptFile = "ib_test.sh"
inFiles.append(os.path.join(os.getcwd(),scriptFile))
+ postFile = "post_csv.py"
+ inFiles.append(os.path.join(os.getcwd(),postFile))
txtYacsJobParameters=yacsJobParameters.format(
nomEtude = self.JobName,
workDirectory = self.WorkDirectory,
pass
- def get_result(self,postProcessedVar, aggregationFct):
- from post_cvs import get_result_from_csv
+ def get_result_from_csv(self,postProcessedVar, aggregationFctList):
+ from post_csv import get_result_from_csv
+ #Fonctions a implementer dans un fichier post_csv pour définir
+ #comment l'aggrégation des valeurs peut se faire
+ from post_csv import vInitialTime, vHalfTime, vFinalTime, vMean, vSum, vMin, vMax
print('--------------------------------------- 4 ---------------------------------------')
- return get_result_from_csv(postProcessedVar, aggregationFct)
+ return get_result_from_csv(postProcessedVar, aggregationFctList)
def run_case(self):
print('--------------------------------------- 5 ---------------------------------------')
# /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=""" {variableOutput} = study.get_result('{variablePostraitee}', {fonctionAggregation} )
+getResultCall=""" {variableOutputList} = study.get_result_from_csv( '{nomVarPostraite}', [{fonctionAggregationList}] )
"""
#-------------------------
# ------------------------
fonctionPersalys = """
def _exec({chaineDesVariablesInput}):
+ from post_csv import vInitialTime, vHalfTime, vFinalTime, vMean, vSum, vMin, vMax
+
print('--------------------------------------- 00 ---------------------------------------')
from {currentFile} import Study