practice, it allows to call one or several times the operator, activating or not
the "debug" mode during execution.
-Statistics on input and output vectors for each execution of operator are given,
-and an another global statistic is given at the end of the checking algorithm.
-The precision of printed outputs can be controlled to facilitate automatic tests
-of operator.
+Statistics on input and output vectors for each execution of operator are
+given, and an another global statistic is given at the end of the checking
+algorithm. The precision of printed outputs can be controlled to facilitate
+automatic tests of operator. It may also be useful to check the entries
+themselves beforehand with the intended test
+:ref:`section_ref_algorithm_InputValuesTest`.
.. ------------------------------------ ..
.. include:: snippets/Header2Algo02.rst
.. ------------------------------------ ..
.. include:: snippets/Header2Algo06.rst
+- :ref:`section_ref_algorithm_InputValuesTest`
- :ref:`section_ref_algorithm_LinearityTest`
- :ref:`section_ref_algorithm_ParallelFunctionTest`
--- /dev/null
+..
+ Copyright (C) 2008-2020 EDF R&D
+
+ This file is part of SALOME ADAO module.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ 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
+
+.. index:: single: InputValuesTest
+.. _section_ref_algorithm_InputValuesTest:
+
+Checking algorithm "*InputValuesTest*"
+--------------------------------------
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo00.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo01.rst
+
+This algorithm verifies the content of the current input variables and the way
+the data is interpreted or read during its acquisition, through the display of
+size information and statistics on the inputs. It also allows to display the
+whole content of the variables read in printed form for verification (*warning,
+if a variable is large in size, this can be difficult*).
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo02.rst
+
+.. include:: snippets/Background.rst
+
+.. include:: snippets/CheckingPoint.rst
+
+.. include:: snippets/Observation.rst
+
+*Tips for this algorithm:*
+
+ Because *"ObservationOperator"* is a required command for ALL checking
+ algorithms in the graphical interface, you have to provide a value for it,
+ despite the fact that this command is not required for this test, and will
+ not be used. The easiest way is to give "1" as a STRING,
+ *"ObservationOperator"* having to be of type *Matrix*.
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo03Chck.rst
+
+.. include:: snippets/NumberOfPrintedDigits.rst
+
+.. include:: snippets/PrintAllValuesFor.rst
+
+.. include:: snippets/ShowInformationOnlyFor.rst
+
+.. include:: snippets/SetDebug.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo06.rst
+
+- :ref:`section_ref_algorithm_FunctionTest`
+- :ref:`section_ref_algorithm_ParallelFunctionTest`
Because *"CheckingPoint"* and *"ObservationOperator"* are required commands
for ALL checking algorithms in the interface, you have to provide a value
- for them, despite the fact that these commands are not required for
- *"ObserverTest"*, and will not be used. The easiest way is to give "1" as a
- STRING for both, *"ObservationOperator"* having to be of type *Matrix*.
+ for them, despite the fact that these commands are not required for this
+ test, and will not be used. The easiest way is to give "1" as a STRING for
+ both, *"ObservationOperator"* having to be of type *Matrix*.
algorithms. In practice, it allows to call one or several times the operator in
parallel, activating or not the "debug" mode during execution.
-Statistics on input and output vectors for each execution of operator are given,
-and an another global statistic is given at the end of the checking algorithm.
-The precision of printed outputs can be controlled to facilitate automatic tests
-of operator.
+Statistics on input and output vectors for each execution of operator are
+given, and an another global statistic is given at the end of the checking
+algorithm. The precision of printed outputs can be controlled to facilitate
+automatic tests of operator. It may also be useful to check the entries
+themselves beforehand with the intended test
+:ref:`section_ref_algorithm_InputValuesTest`.
.. ------------------------------------ ..
.. include:: snippets/Header2Algo02.rst
.. include:: snippets/Header2Algo06.rst
- :ref:`section_ref_algorithm_FunctionTest`
+- :ref:`section_ref_algorithm_InputValuesTest`
- :ref:`section_ref_algorithm_LinearityTest`
:ref:`section_notations` are also used, together with
:ref:`section_ref_entry_types_names`.
+The explicit :ref:`section_ref_algorithm_InputValuesTest` test is designed so
+that the user can specifically check some entries, with the same analysis and
+criteria as during the usual setup of a study.
+
.. _section_ref_entry_types_math:
Pseudo-types of mathematical representation of data
ref_algorithm_AdjointTest
ref_algorithm_FunctionTest
ref_algorithm_GradientTest
+ ref_algorithm_InputValuesTest
ref_algorithm_LinearityTest
ref_algorithm_LocalSensitivityTest
ref_algorithm_ObserverTest
--- /dev/null
+.. index:: single: PrintAllValuesFor
+
+PrintAllValuesFor
+ This key indicates the list of vector names whose detailed values are to be
+ printed, the default value being the empty list. If the named vector is not a
+ supplied entry, the name is simply ignored. The possible names are in the
+ following list: [
+ "Background",
+ "CheckingPoint",
+ "Observation",
+ ].
+
+ Exemple :
+ ``{"PrintAllValuesFor":["Background"]}``
--- /dev/null
+.. index:: single: ShowInformationOnlyFor
+
+ShowInformationOnlyFor
+ This key indicates the list of vector names whose summarized information
+ (size, min/max...) is to be printed, the default value being the set of
+ vectors. If the named vector is not a provided entry, the name is simply
+ ignored. This allows you to restrict summarized printing. The possible names
+ are in the following list: [
+ "Background",
+ "CheckingPoint",
+ "Observation",
+ ].
+
+ Exemple :
+ ``{"ShowInformationOnlyFor":["Background"]}``
l'opérateur est indiquée, et une autre globale est fournie de manière
récapitulative à la fin de l'algorithme de vérification. La précision
d'affichage est contrôlable pour permettre l'automatisation des tests
-d'opérateur.
+d'opérateur. Il peut être aussi utile de vérifier préalablement les entrées
+elles-mêmes avec le test prévu :ref:`section_ref_algorithm_InputValuesTest`.
.. ------------------------------------ ..
.. include:: snippets/Header2Algo02.rst
.. ------------------------------------ ..
.. include:: snippets/Header2Algo06.rst
+- :ref:`section_ref_algorithm_InputValuesTest`
- :ref:`section_ref_algorithm_LinearityTest`
- :ref:`section_ref_algorithm_ParallelFunctionTest`
--- /dev/null
+..
+ Copyright (C) 2008-2020 EDF R&D
+
+ This file is part of SALOME ADAO module.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ 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
+
+.. index:: single: InputValuesTest
+.. _section_ref_algorithm_InputValuesTest:
+
+Algorithme de vérification "*InputValuesTest*"
+----------------------------------------------
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo00.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo01.rst
+
+Cet algorithme permet de vérifier le contenu des variables d'entrée courantes
+et la manière dont les données sont interprétées ou lues lors de leur
+acquisition, à travers l'affichage des informations de taille et des
+statistique sur les entrées. Il permet aussi de restituer la totalité du
+contenu des variables lues sous forme imprimée pour vérification (*attention,
+si une variable est de grande taille, cette restitution peut être
+informatiquement problématique*).
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo02.rst
+
+.. include:: snippets/Background.rst
+
+.. include:: snippets/CheckingPoint.rst
+
+.. include:: snippets/Observation.rst
+
+*Astuce pour cet algorithme :*
+
+ Comme la commande *"ObservationOperator"* est requise pour TOUS les
+ algorithmes de vérification dans l'interface graphique, vous devez fournir
+ une valeur, malgré le fait que cette commandes ne soit pas nécessaires pour
+ cet test, et ne soit donc pas utilisée. La manière la plus simple est de
+ donner "1" comme un STRING, l'*"ObservationOperator"* devant être de type
+ *Matrix*.
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo03Chck.rst
+
+.. include:: snippets/NumberOfPrintedDigits.rst
+
+.. include:: snippets/PrintAllValuesFor.rst
+
+.. include:: snippets/ShowInformationOnlyFor.rst
+
+.. include:: snippets/SetDebug.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo06.rst
+
+- :ref:`section_ref_algorithm_FunctionTest`
+- :ref:`section_ref_algorithm_ParallelFunctionTest`
Comme les commandes *"CheckingPoint"* et *"ObservationOperator"* sont
requises pour TOUS les algorithmes de vérification dans l'interface, vous
devez fournir une valeur, malgré le fait que ces commandes ne soient pas
- nécessaires pour cet algorithme, et ne sont donc pas utilisées. La manière
- la plus simple est de donner "1" comme un STRING pour les deux,
+ nécessaires pour ce test, et ne sont donc pas utilisées. La manière la plus
+ simple est de donner "1" comme un STRING pour les deux,
l'*"ObservationOperator"* devant être de type *Matrix*.
l'opérateur est indiquée, et une autre globale est fournie de manière
récapitulative à la fin de l'algorithme de vérification. La précision
d'affichage est contrôlable pour permettre l'automatisation des tests
-d'opérateur.
+d'opérateur. Il peut être aussi utile de vérifier préalablement les entrées
+elles-mêmes avec le test prévu :ref:`section_ref_algorithm_InputValuesTest`.
.. ------------------------------------ ..
.. include:: snippets/Header2Algo02.rst
.. include:: snippets/Header2Algo06.rst
- :ref:`section_ref_algorithm_FunctionTest`
+- :ref:`section_ref_algorithm_InputValuesTest`
- :ref:`section_ref_algorithm_LinearityTest`
utilise aussi les :ref:`section_notations`, en même temps que les
:ref:`section_ref_entry_types_names`.
+Le test explicite :ref:`section_ref_algorithm_InputValuesTest` est prévu pour
+que l'utilisateur puisse vérifier spécifiquement certaines entrées, avec les
+mêmes analyses et critères que lors de la mise en place usuelle d'une étude.
+
.. _section_ref_entry_types_math:
Pseudo-types de représentation mathématique des données
ref_algorithm_AdjointTest
ref_algorithm_FunctionTest
ref_algorithm_GradientTest
+ ref_algorithm_InputValuesTest
ref_algorithm_LinearityTest
ref_algorithm_LocalSensitivityTest
ref_algorithm_ObserverTest
--- /dev/null
+.. index:: single: PrintAllValuesFor
+
+PrintAllValuesFor
+ Cette clé indique la liste des noms de vecteurs dont les valeurs détaillées
+ sont à imprimer, la valeur par défaut étant la liste vide. Si le vecteur
+ nommé n'est pas une entrée fournie, le nom est simplement ignoré. Les noms
+ possibles sont dans la liste suivante : [
+ "Background",
+ "CheckingPoint",
+ "Observation",
+ ].
+
+ Exemple :
+ ``{"PrintAllValuesFor":["Background"]}``
--- /dev/null
+.. index:: single: ShowInformationOnlyFor
+
+ShowInformationOnlyFor
+ Cette clé indique la liste des noms de vecteurs dont les informations
+ synthétiques (taille, min/max...) sont à imprimer, la valeur par défaut étant
+ l'ensemble des vecteurs. Si le vecteur nommé n'est pas une entrée fournie, le
+ nom est simplement ignoré. Cela permet de restreindre les impressions
+ synthétiques. Les noms possibles sont dans la liste suivante : [
+ "Background",
+ "CheckingPoint",
+ "Observation",
+ ].
+
+ Exemple :
+ ``{"ShowInformationOnlyFor":["Background"]}``
minval = 0,
)
self.defineRequiredParameter(
- name = "PrintValuesFor",
+ name = "PrintAllValuesFor",
default = [],
typecast = tuple,
- message = "Liste de vecteurs dont les valeurs sont à imprimer",
+ message = "Liste de noms de vecteurs dont les valeurs détaillées sont à imprimer",
+ listval = [
+ "Background",
+ "CheckingPoint",
+ "Observation",
+ ]
+ )
+ self.defineRequiredParameter(
+ name = "ShowInformationOnlyFor",
+ default = ["Background", "CheckingPoint", "Observation"],
+ typecast = tuple,
+ message = "Liste de noms de vecteurs dont les informations synthétiques sont à imprimer",
listval = [
"Background",
"CheckingPoint",
numpy.set_printoptions(precision=_p)
#
def __buildPrintableVectorProperties( __name, __vector ):
- if __vector is None: return ""
- if len(__vector) == 0: return ""
- if hasattr(__vector,"name") and __name != __vector.name():
- return ""
+ if __vector is None: return ""
+ if len(__vector) == 0: return ""
+ if hasattr(__vector,"name") and __name != __vector.name(): return ""
+ if __name not in self._parameters["ShowInformationOnlyFor"]: return ""
#
- __title = "Information for %svector:"%(str(__name)+" ",)
+ if hasattr(__vector,"mins"):
+ __title = "Information for %svector series:"%(str(__name)+" ",)
+ else:
+ __title = "Information for %svector:"%(str(__name)+" ",)
msgs = "\n"
msgs += ("===> "+__title+"\n")
msgs += (" "+("-"*len(__title))+"\n")
msgs += (" Serie of maximum values...: %s\n")%numpy.array(__vector.maxs())
else:
msgs += (" Maximum of vector.........: %12."+str(_p)+"e\n")%__vector.max()
- if self._parameters["SetDebug"] or __name in self._parameters["PrintValuesFor"]:
+ if self._parameters["SetDebug"] or __name in self._parameters["PrintAllValuesFor"]:
msgs += ("\n")
msgs += (" Printing all values :\n")
msgs += ("%s"%(__vector,))
_EI = numpy.diag(1./numpy.sqrt(numpy.diag(_A)))
_C = numpy.dot(_EI, numpy.dot(_A, _EI))
self.StoredVariables["APosterioriCorrelations"].store( _C )
- if _oH is not None:
+ if _oH is not None and "Direct" in _oH and "Tangent" in _oH and "Adjoint" in _oH:
logging.debug("%s Nombre d'évaluation(s) de l'opérateur d'observation direct/tangent/adjoint.: %i/%i/%i", self._name, _oH["Direct"].nbcalls(0),_oH["Tangent"].nbcalls(0),_oH["Adjoint"].nbcalls(0))
logging.debug("%s Nombre d'appels au cache d'opérateur d'observation direct/tangent/adjoint..: %i/%i/%i", self._name, _oH["Direct"].nbcalls(3),_oH["Tangent"].nbcalls(3),_oH["Adjoint"].nbcalls(3))
logging.debug("%s Taille mémoire utilisée de %.0f Mio", self._name, self._m.getUsedMemory("Mio"))