# -*- coding: utf-8 -*-
#
-# Copyright (C) 2008-2021 EDF R&D
+# Copyright (C) 2008-2022 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
self.__adaoObject[ename] = None
for ename in ("ObservationOperator", "EvolutionModel", "ControlModel"):
self.__adaoObject[ename] = {}
+ for ename in ("BackgroundError", "ObservationError"):
+ self.__adaoObject[ename] = Covariance(ename, asEyeByScalar = 1.)
+ for ename in ("EvolutionError",):
+ self.__adaoObject[ename] = Covariance(ename, asEyeByScalar = 1.e-16)
for ename in ("Observer", "UserPostAnalysis"):
self.__adaoObject[ename] = []
self.__StoredInputs[ename] = [] # Vide par defaut
Concept = None, # Premier argument
Algorithm = None,
AppliedInXb = None,
- AvoidRC = True,
Checked = False,
ColMajor = False,
ColNames = None,
ObjectMatrix = None,
OneFunction = None,
Parameters = None,
+ PerformanceProfile = None,
ScalarSparseMatrix = None,
Scheduler = None,
Script = None,
self.setObservationOperator(
Matrix, OneFunction, ThreeFunctions, AppliedInXb,
Parameters, Script, ExtraArguments,
- Stored, AvoidRC, InputFunctionAsMulti, Checked )
+ Stored, PerformanceProfile, InputFunctionAsMulti, Checked )
elif Concept in ("EvolutionModel", "ControlModel"):
commande = getattr(self,"set"+Concept)
commande(
Matrix, OneFunction, ThreeFunctions,
Parameters, Script, Scheduler, ExtraArguments,
- Stored, AvoidRC, InputFunctionAsMulti, Checked )
+ Stored, PerformanceProfile, InputFunctionAsMulti, Checked )
else:
raise ValueError("the variable named '%s' is not allowed."%str(Concept))
except Exception as e:
- if isinstance(e, SyntaxError): msg = "at %s: %s"%(e.offset, e.text)
+ if isinstance(e, SyntaxError): msg = " at %s: %s"%(e.offset, e.text)
else: msg = ""
raise ValueError(("during settings, the following error occurs:\n"+\
- "\n%s %s\n\nSee also the potential messages, "+\
+ "\n%s%s\n\nSee also the potential messages, "+\
"which can show the origin of the above error, "+\
"in the launching terminal.")%(str(e),msg))
Script = None,
ExtraArguments = None,
Stored = False,
- AvoidRC = True,
+ PerformanceProfile = None,
InputFunctionAsMulti = False,
Checked = False):
"Definition d'un concept de calcul"
asDict = Parameters,
appliedInX = AppliedInXb,
extraArguments = ExtraArguments,
- avoidRC = AvoidRC,
+ performancePrf = PerformanceProfile,
inputAsMF = InputFunctionAsMulti,
scheduledBy = None,
toBeChecked = Checked,
Scheduler = None,
ExtraArguments = None,
Stored = False,
- AvoidRC = True,
+ PerformanceProfile = None,
InputFunctionAsMulti = False,
Checked = False):
"Definition d'un concept de calcul"
asDict = Parameters,
appliedInX = None,
extraArguments = ExtraArguments,
- avoidRC = AvoidRC,
+ performancePrf = PerformanceProfile,
inputAsMF = InputFunctionAsMulti,
scheduledBy = Scheduler,
toBeChecked = Checked,
Scheduler = None,
ExtraArguments = None,
Stored = False,
- AvoidRC = True,
+ PerformanceProfile = None,
InputFunctionAsMulti = False,
Checked = False):
"Definition d'un concept de calcul"
asDict = Parameters,
appliedInX = None,
extraArguments = ExtraArguments,
- avoidRC = AvoidRC,
+ performancePrf = PerformanceProfile,
inputAsMF = InputFunctionAsMulti,
scheduledBy = Scheduler,
toBeChecked = Checked,
asString = String,
asScript = self.__with_directory(Script),
)))
+ return 0
# -----------------------------------------------------------
self.dump( FileName, "TUI")
self.__adaoObject["AlgorithmParameters"].executePythonScheme( self.__adaoObject )
if "UserPostAnalysis" in self.__adaoObject and len(self.__adaoObject["UserPostAnalysis"])>0:
- __Upa = eval("\n".join([str(val).replace("ADD.","self.") for val in self.__adaoObject["UserPostAnalysis"]]))
- exec(__Upa, {}, {'self':self})
+ self.__objname = self.__retrieve_objname()
+ for __UpaOne in self.__adaoObject["UserPostAnalysis"]:
+ __UpaOne = eval(str(__UpaOne))
+ exec(__UpaOne, {}, {'self':self, 'ADD':self, 'case':self, 'adaopy':self, self.__objname:self})
return 0
def __executeYACSScheme(self, FileName=None):
for level in reversed(inspect.stack()):
__names += [name for name, value in level.frame.f_locals.items() if value is self]
__names += [name for name, value in globals().items() if value is self]
- __names.remove('self') # Devrait toujours être trouvé, donc pas d'erreur
+ while 'self' in __names: __names.remove('self') # Devrait toujours être trouvé, donc pas d'erreur
if len(__names) > 0:
- logging.debug("Cet objet est appelé par au moins une variable :",__names)
self.__objname = __names[0]
else:
self.__objname = "ADD"