# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
name = "ADAO"
-version = "V8_3_0" # Version pour catalogue, avec des "_" entre les numeros
+version = "V8_4_0" # Version pour catalogue, avec des "_" entre les numeros
date = ""
year = "2017" # Annee de copyright
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
+
Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
-->
<document>
<parameter name="icon" value="ADAO.png"/>
<parameter name="library" value="SalomePyQtGUI"/>
<parameter name="documentation" value="adao_help"/>
- <parameter name="version" value="8.3.0"/>
+ <parameter name="version" value="8.4.0"/>
</section>
<section name="resources">
<!-- Module resources -->
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
# Correction pour pallier a un bug de TNC sur le retour du Minimum
if "Minimizer" in self._parameters and self._parameters["Minimizer"] == "TNC":
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
# Correction pour pallier a un bug de TNC sur le retour du Minimum
if "Minimizer" in self._parameters and self._parameters["Minimizer"] == "TNC":
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Direct"].appliedTo
Ht = HO["Tangent"].appliedInXTo
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Tangent"].asMatrix(Xb)
Hm = Hm.reshape(Y.size,Xb.size) # ADAO & check shape
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
if not PlatformInfo.has_nlopt and not self._parameters["Minimizer"] in ["COBYLA", "POWELL", "SIMPLEX"]:
logging.debug("%s Absence de NLopt, utilisation forcee du minimiseur SIMPLEX"%(self._name,))
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
# Précalcul des inversions de B et R
# ----------------------------------
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Tangent"].asMatrix(Xb)
Hm = Hm.reshape(Y.size,Xb.size) # ADAO & check shape
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
if self._parameters["EstimationOf"] == "Parameters":
self._parameters["StoreInternalVariables"] = True
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Direct"].appliedTo
#
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Direct"].appliedTo
if self._parameters["ResiduFormula"] in ["Taylor", "TaylorOnNorm"]:
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
if self._parameters["EstimationOf"] == "Parameters":
self._parameters["StoreInternalVariables"] = True
listval = ["OMA", "CurrentState", "CostFunctionJ", "CostFunctionJb", "CostFunctionJo", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]
)
self.requireInputArguments(
- mandatory= ("Xb", "Y", "HO", "R"),
+ mandatory= ("Y", "HO", "R"),
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Tangent"].asMatrix(None)
Hm = Hm.reshape(Y.size,-1) # ADAO & check shape
listval = ["CurrentState", "Residu", "SimulatedObservationAtCurrentState"]
)
self.requireInputArguments(
- mandatory= ("Xb", "Y", "HO"),
+ mandatory= ("Xb", "HO"),
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
def RMS(V1, V2):
import math
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
# Correction pour pallier a un bug de TNC sur le retour du Minimum
if "Minimizer" in self._parameters and self._parameters["Minimizer"] == "TNC":
BasicObjects.Algorithm.__init__(self, "OBSERVERTEST")
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
print("Results of observer check on all potential variables or commands,")
print(" only activated on selected ones by explicit association.")
print("")
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
if ("BoxBounds" in self._parameters) and isinstance(self._parameters["BoxBounds"], (list, tuple)) and (len(self._parameters["BoxBounds"]) > 0):
BoxBounds = self._parameters["BoxBounds"]
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Direct"].appliedTo
#
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Direct"].appliedTo
#
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
if self._parameters["NoiseDistribution"] == "Uniform":
nrange = numpy.ravel(self._parameters["NoiseHalfRange"]) # Vecteur
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
Hm = HO["Direct"].appliedTo
Ht = HO["Tangent"].appliedInXTo
)
def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
- self._pre_run(Parameters, R, B, Q)
+ self._pre_run(Parameters, Xb, Y, R, B, Q)
#
if self._parameters["EstimationOf"] == "Parameters":
self._parameters["StoreInternalVariables"] = True
self.__FO["Tangent"] = Operator( fromMethod = __Function["Tangent"], avoidingRedundancy = avoidRC )
self.__FO["Adjoint"] = Operator( fromMethod = __Function["Adjoint"], avoidingRedundancy = avoidRC )
elif asMatrix is not None:
- __matrice = numpy.matrix( asMatrix, numpy.float )
+ __matrice = numpy.matrix( __Matrix, numpy.float )
self.__FO["Direct"] = Operator( fromMatrix = __matrice, avoidingRedundancy = avoidRC )
self.__FO["Tangent"] = Operator( fromMatrix = __matrice, avoidingRedundancy = avoidRC )
self.__FO["Adjoint"] = Operator( fromMatrix = __matrice.T, avoidingRedundancy = avoidRC )
self.StoredVariables["SimulationQuantiles"] = Persistence.OneMatrix(name = "SimulationQuantiles")
self.StoredVariables["Residu"] = Persistence.OneScalar(name = "Residu")
- def _pre_run(self, Parameters, R=None, B=None, Q=None ):
+ def _pre_run(self, Parameters, Xb=None, Y=None, R=None, B=None, Q=None ):
"Pré-calcul"
logging.debug("%s Lancement", self._name)
logging.debug("%s Taille mémoire utilisée de %.0f Mio", self._name, self._m.getUsedMemory("Mio"))
self.__setParameters(Parameters)
#
# Corrections et complements
+ def __test_vvalue( argument, variable, argname):
+ if argument is None:
+ if variable in self.__required_inputs["RequiredInputValues"]["mandatory"]:
+ raise ValueError("%s %s vector %s has to be properly defined!"%(self._name,argname,variable))
+ elif variable in self.__required_inputs["RequiredInputValues"]["optional"]:
+ logging.debug("%s %s vector %s is not set, but is optional."%(self._name,argname,variable))
+ else:
+ logging.debug("%s %s vector %s is not set, but is not required."%(self._name,argname,variable))
+ else:
+ logging.debug("%s %s vector %s is set, and its size is %i."%(self._name,argname,variable,numpy.array(argument).size))
+ __test_vvalue( Xb, "Xb", "Background or initial state" )
+ __test_vvalue( Y, "Y", "Observation" )
def __test_cvalue( argument, variable, argname):
if argument is None:
if variable in self.__required_inputs["RequiredInputValues"]["mandatory"]:
"Verifie l'existence et importe le script"
self.__filename = __filename.rstrip(".py")
if self.__filename is None:
- raise ValueError("The name of the file containing the variable to be imported has to be specified.")
+ raise ValueError("The name of the file, containing the variable to be read, has to be specified.")
if not os.path.isfile(str(self.__filename)+".py"):
- raise ValueError("The file containing the variable to be imported doesn't seem to exist. The given file name is:\n \"%s\""%self.__filename)
+ raise ValueError("The file containing the variable to be imported doesn't seem to exist. Please check the file. The given file name is:\n \"%s\""%self.__filename)
self.__scriptfile = __import__(self.__filename, globals(), locals(), [])
self.__scriptstring = open(self.__filename+".py",'r').read()
def getvalue(self, __varname=None, __synonym=None ):
"Renvoie la variable demandee"
if __varname is None:
- raise ValueError("The name of the variable to be imported has to be specified.")
+ raise ValueError("The name of the variable to be read has to be specified. Please check the content of the file and the syntax.")
if not hasattr(self.__scriptfile, __varname):
if __synonym is None:
- raise ValueError("The imported script file \"%s\" doesn't contain the specified variable \"%s\"."%(str(self.__filename)+".py",__varname))
+ raise ValueError("The imported script file \"%s\" doesn't contain the mandatory variable \"%s\" to be read. Please check the content of the file and the syntax."%(str(self.__filename)+".py",__varname))
elif not hasattr(self.__scriptfile, __synonym):
- raise ValueError("The imported script file \"%s\" doesn't contain the specified variable \"%s\"."%(str(self.__filename)+".py",__synonym))
+ raise ValueError("The imported script file \"%s\" doesn't contain the mandatory variable \"%s\" to be read. Please check the content of the file and the syntax."%(str(self.__filename)+".py",__synonym))
else:
return getattr(self.__scriptfile, __synonym)
else:
__all__ = []
name = "Data Assimilation Package"
-version = "17.04.30"
-date = "samedi 30 avril 2017, 12:12:12 (UTC+0100)"
+version = "2017.09.30"
+date = "samedi 30 septembre 2017, 12:12:12 (UTC+0100)"