From 1d3fd190268c31e0a94dbba375bceed4f0868c15 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Sun, 5 Apr 2015 01:31:56 +0200 Subject: [PATCH] Documentation and source improvements --- bin/AdaoCatalogGenerator.py | 1 + doc/en/index.rst | 16 +++++----- doc/en/ref_algorithm_3DVAR.rst | 29 +++++++++++++++---- doc/en/ref_algorithm_Blue.rst | 28 +++++++++++++++--- doc/en/ref_algorithm_ExtendedBlue.rst | 28 +++++++++++++++--- doc/en/ref_algorithm_ExtendedKalmanFilter.rst | 24 +++++++++++++-- doc/en/ref_algorithm_KalmanFilter.rst | 24 +++++++++++++-- .../ref_algorithm_NonLinearLeastSquares.rst | 5 ++-- .../ref_algorithm_UnscentedKalmanFilter.rst | 24 +++++++++++++-- doc/fr/index.rst | 18 ++++++------ doc/fr/ref_algorithm_3DVAR.rst | 29 +++++++++++++++---- doc/fr/ref_algorithm_Blue.rst | 28 +++++++++++++++--- doc/fr/ref_algorithm_ExtendedBlue.rst | 28 +++++++++++++++--- doc/fr/ref_algorithm_ExtendedKalmanFilter.rst | 24 +++++++++++++-- doc/fr/ref_algorithm_KalmanFilter.rst | 24 +++++++++++++-- .../ref_algorithm_NonLinearLeastSquares.rst | 7 ++--- .../ref_algorithm_UnscentedKalmanFilter.rst | 24 +++++++++++++-- src/daComposant/daAlgorithms/3DVAR.py | 2 +- src/daComposant/daAlgorithms/Blue.py | 2 +- src/daComposant/daAlgorithms/ExtendedBlue.py | 2 +- .../daAlgorithms/ExtendedKalmanFilter.py | 2 +- src/daComposant/daAlgorithms/KalmanFilter.py | 2 +- src/daComposant/daAlgorithms/ObserverTest.py | 3 ++ src/daComposant/daAlgorithms/SamplingTest.py | 2 +- .../daAlgorithms/UnscentedKalmanFilter.py | 2 +- src/daComposant/daCore/BasicObjects.py | 17 +++++++++++ .../daNumerics/ApproximatedDerivatives.py | 2 ++ src/daEficas/generator_adao.py | 2 ++ .../daYacsIntegration/daOptimizerLoop.py | 2 +- .../daYacsSchemaCreator/infos_daComposant.py | 3 ++ src/daSalome/daYacsSchemaCreator/methods.py | 4 +++ 31 files changed, 338 insertions(+), 70 deletions(-) diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index 20a1547..55a322c 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -90,6 +90,7 @@ def F_${data_name}(statut) : return FACT( DifferentialIncrement = SIMP(statut="o", typ = "R", val_min=0, val_max=1, defaut=0.01, fr="Incrément de la perturbation dX pour calculer la dérivée, construite en multipliant X par l'incrément en évitant les valeurs nulles", ang="Increment of dX perturbation to calculate the derivative, build multiplying X by the increment avoiding null values"), CenteredFiniteDifference = SIMP(statut="o", typ = "I", into=(0, 1), defaut=0, fr="Formulation centrée (1) ou décentrée (0) pour la méthode des différences finies", ang="Centered (1) or uncentered (0) formulation for the finite differences method"), EnableMultiProcessing = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0, fr="Calculs élémentaires effectués en séquentiel (0) ou en parallèle (1) dans la méthode des différences finies", ang="Elementary calculations done sequentially (0) or in parallel (1) in the finite differences method"), + NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"), ), SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ", SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant un switch pour les calculs direct, tangent et adjoint", ang="Waiting for a script file name, with or without the full path to find it, containing a switch for direct, tangent and adjoint computations"), diff --git a/doc/en/index.rst b/doc/en/index.rst index 15a6002..9d43432 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -29,7 +29,7 @@ ADAO documentation .. image:: images/ADAO_logo.png :align: center - :width: 20% + :alt: ADAO logo The ADAO module provides **data assimilation and optimization** features in SALOME context. It is based on usage of other SALOME modules, namely YACS and @@ -51,12 +51,12 @@ introduces :ref:`section_theory`, and their concepts. The third part describes :ref:`section_using`, and the fourth part gives examples on ADAO usage as :ref:`section_examples`. Users interested in quick use of the module can stop before reading the rest, but a valuable use of the module requires to read and -come back regularly to the third and seventh parts. The fifth and sixth parts -indicate :ref:`section_advanced`, with obtaining additional information or the -use of non-GUI execution scripting, and a :ref:`section_tui` of the module. The -seventh part gives a detailed :ref:`section_reference`, with three main -sub-parts following. And, to respect the module requirements, be sure to read -the part :ref:`section_license`. +come back regularly to the third and seventh parts. The fifth part indicate +:ref:`section_advanced`, with obtaining additional information or the use of +non-GUI execution scripting. The next part gives a detailed +:ref:`section_reference`, with four main sub-parts following, the last one +giving a :ref:`section_tui` of the module. And, to respect the module +requirements, be sure to read the part :ref:`section_license`. In all this documentation, we use standard notations of linear algebra, data assimilation (as described in [Ide97]_) and optimization. In particular, vectors @@ -76,8 +76,8 @@ Table of contents using examples advanced - tui reference + tui license glossary bibliography diff --git a/doc/en/ref_algorithm_3DVAR.rst b/doc/en/ref_algorithm_3DVAR.rst index d2f442b..a946bbb 100644 --- a/doc/en/ref_algorithm_3DVAR.rst +++ b/doc/en/ref_algorithm_3DVAR.rst @@ -163,11 +163,12 @@ The options of the algorithm are the following: available at the end of the algorithm. It involves potentially costly calculations or memory consumptions. The default is a void list, none of these variables being calculated and stored by default. The possible names - are in the following list: ["APosterioriCovariance", "BMA", "CostFunctionJ", - "CurrentState", "OMA", "OMB", "Innovation", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtBackground", - "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum", - "SimulationQuantiles"]. + are in the following list: ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "OMA", + "OMB", "Innovation", "SigmaObs2", "MahalanobisConsistency", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum", "SimulationQuantiles"]. Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -247,12 +248,30 @@ The unconditional outputs of the algorithm are the following: The conditional outputs of the algorithm are the following: + APosterioriCorrelations + *List of matrices*. Each element is an *a posteriori* error correlation + matrix of the optimal state. + + Example : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *List of matrices*. Each element is an *a posteriori* error covariance matrix :math:`\mathbf{A}*` of the optimal state. Example : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *List of matrices*. Each element is an *a posteriori* error standard + deviation matrix of the optimal state. + + Example : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *List of matrices*. Each element is an *a posteriori* error variance matrix + of the optimal state. + + Example : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *List of vectors*. Each element is a vector of difference between the background and the optimal state. diff --git a/doc/en/ref_algorithm_Blue.rst b/doc/en/ref_algorithm_Blue.rst index 8fb5bc2..da5e64b 100644 --- a/doc/en/ref_algorithm_Blue.rst +++ b/doc/en/ref_algorithm_Blue.rst @@ -108,10 +108,12 @@ The options of the algorithm are the following: available at the end of the algorithm. It involves potentially costly calculations or memory consumptions. The default is a void list, none of these variables being calculated and stored by default. The possible names - are in the following list: ["APosterioriCovariance", "BMA", "CostFunctionJ", - "OMA", "OMB", "Innovation", "SigmaBck2", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtBackground", - "SimulatedObservationAtOptimum", "SimulationQuantiles"]. + are in the following list: ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", + "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", + "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", + "SimulationQuantiles"]. Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -174,12 +176,30 @@ The unconditional outputs of the algorithm are the following: The conditional outputs of the algorithm are the following: + APosterioriCorrelations + *List of matrices*. Each element is an *a posteriori* error correlation + matrix of the optimal state. + + Example : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *List of matrices*. Each element is an *a posteriori* error covariance matrix :math:`\mathbf{A}*` of the optimal state. Example : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *List of matrices*. Each element is an *a posteriori* error standard + deviation matrix of the optimal state. + + Example : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *List of matrices*. Each element is an *a posteriori* error variance matrix + of the optimal state. + + Example : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *List of vectors*. Each element is a vector of difference between the background and the optimal state. diff --git a/doc/en/ref_algorithm_ExtendedBlue.rst b/doc/en/ref_algorithm_ExtendedBlue.rst index 9768399..675adc0 100644 --- a/doc/en/ref_algorithm_ExtendedBlue.rst +++ b/doc/en/ref_algorithm_ExtendedBlue.rst @@ -106,10 +106,12 @@ The options of the algorithm are the following: available at the end of the algorithm. It involves potentially costly calculations or memory consumptions. The default is a void list, none of these variables being calculated and stored by default. The possible names - are in the following list: ["APosterioriCovariance", "BMA", - "CostFunctionJ", "OMA", "OMB", "Innovation", "SigmaBck2", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtBackground", - "SimulatedObservationAtOptimum", "SimulationQuantiles"]. + are in the following list: ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", + "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", + "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", + "SimulationQuantiles"]. Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -172,12 +174,30 @@ The unconditional outputs of the algorithm are the following: The conditional outputs of the algorithm are the following: + APosterioriCorrelations + *List of matrices*. Each element is an *a posteriori* error correlation + matrix of the optimal state. + + Example : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *List of matrices*. Each element is an *a posteriori* error covariance matrix :math:`\mathbf{A}*` of the optimal state. Example : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *List of matrices*. Each element is an *a posteriori* error standard + deviation matrix of the optimal state. + + Example : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *List of matrices*. Each element is an *a posteriori* error variance matrix + of the optimal state. + + Example : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *List of vectors*. Each element is a vector of difference between the background and the optimal state. diff --git a/doc/en/ref_algorithm_ExtendedKalmanFilter.rst b/doc/en/ref_algorithm_ExtendedKalmanFilter.rst index 5726f1f..2ea62c3 100644 --- a/doc/en/ref_algorithm_ExtendedKalmanFilter.rst +++ b/doc/en/ref_algorithm_ExtendedKalmanFilter.rst @@ -112,8 +112,10 @@ The options of the algorithm are the following: available at the end of the algorithm. It involves potentially costly calculations or memory consumptions. The default is a void list, none of these variables being calculated and stored by default. The possible names - are in the following list: ["APosterioriCovariance", "BMA", "CostFunctionJ", - "CurrentState", "Innovation"]. + are in the following list: ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", + "Innovation"]. Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -138,12 +140,30 @@ The unconditional outputs of the algorithm are the following: The conditional outputs of the algorithm are the following: + APosterioriCorrelations + *List of matrices*. Each element is an *a posteriori* error correlation + matrix of the optimal state. + + Example : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *List of matrices*. Each element is an *a posteriori* error covariance matrix :math:`\mathbf{A}*` of the optimal state. Example : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *List of matrices*. Each element is an *a posteriori* error standard + deviation matrix of the optimal state. + + Example : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *List of matrices*. Each element is an *a posteriori* error variance matrix + of the optimal state. + + Example : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *List of vectors*. Each element is a vector of difference between the background and the optimal state. diff --git a/doc/en/ref_algorithm_KalmanFilter.rst b/doc/en/ref_algorithm_KalmanFilter.rst index e1d51ab..c40a407 100644 --- a/doc/en/ref_algorithm_KalmanFilter.rst +++ b/doc/en/ref_algorithm_KalmanFilter.rst @@ -111,8 +111,10 @@ The options of the algorithm are the following: available at the end of the algorithm. It involves potentially costly calculations or memory consumptions. The default is a void list, none of these variables being calculated and stored by default. The possible names - are in the following list: ["APosterioriCovariance", "BMA", "CostFunctionJ", - "CurrentState", "Innovation"]. + are in the following list: ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", + "Innovation"]. Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -137,12 +139,30 @@ The unconditional outputs of the algorithm are the following: The conditional outputs of the algorithm are the following: + APosterioriCorrelations + *List of matrices*. Each element is an *a posteriori* error correlation + matrix of the optimal state. + + Example : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *List of matrices*. Each element is an *a posteriori* error covariance matrix :math:`\mathbf{A}*` of the optimal state. Example : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *List of matrices*. Each element is an *a posteriori* error standard + deviation matrix of the optimal state. + + Example : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *List of matrices*. Each element is an *a posteriori* error variance matrix + of the optimal state. + + Example : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *List of vectors*. Each element is a vector of difference between the background and the optimal state. diff --git a/doc/en/ref_algorithm_NonLinearLeastSquares.rst b/doc/en/ref_algorithm_NonLinearLeastSquares.rst index 29d930d..6c2b520 100644 --- a/doc/en/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/en/ref_algorithm_NonLinearLeastSquares.rst @@ -155,9 +155,8 @@ The options of the algorithm are the following: available at the end of the algorithm. It involves potentially costly calculations or memory consumptions. The default is a void list, none of these variables being calculated and stored by default. The possible names - are in the following list: ["APosterioriCovariance", "BMA", - "CostFunctionJ", "CurrentState", "OMA", "OMB", "Innovation", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtCurrentState", + are in the following list: ["BMA", "CostFunctionJ", "CurrentState", "OMA", + "OMB", "Innovation", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` diff --git a/doc/en/ref_algorithm_UnscentedKalmanFilter.rst b/doc/en/ref_algorithm_UnscentedKalmanFilter.rst index b628f2d..e903aa6 100644 --- a/doc/en/ref_algorithm_UnscentedKalmanFilter.rst +++ b/doc/en/ref_algorithm_UnscentedKalmanFilter.rst @@ -127,8 +127,10 @@ The options of the algorithm are the following: available at the end of the algorithm. It involves potentially costly calculations or memory consumptions. The default is a void list, none of these variables being calculated and stored by default. The possible names - are in the following list: ["APosterioriCovariance", "BMA", "CostFunctionJ", - "CurrentState", "Innovation"]. + are in the following list: ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", + "Innovation"]. Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -153,12 +155,30 @@ The unconditional outputs of the algorithm are the following: The conditional outputs of the algorithm are the following: + APosterioriCorrelations + *List of matrices*. Each element is an *a posteriori* error correlation + matrix of the optimal state. + + Example : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *List of matrices*. Each element is an *a posteriori* error covariance matrix :math:`\mathbf{A}*` of the optimal state. Example : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *List of matrices*. Each element is an *a posteriori* error standard + deviation matrix of the optimal state. + + Example : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *List of matrices*. Each element is an *a posteriori* error variance matrix + of the optimal state. + + Example : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *List of vectors*. Each element is a vector of difference between the background and the optimal state. diff --git a/doc/fr/index.rst b/doc/fr/index.rst index 8150580..69850e7 100644 --- a/doc/fr/index.rst +++ b/doc/fr/index.rst @@ -29,7 +29,7 @@ Documentation ADAO .. image:: images/ADAO_logo.png :align: center - :width: 20% + :alt: Logo ADAO Le module ADAO fournit des fonctionnalités d'**assimilation de données et d'optimisation** dans un contexte SALOME. Il est basé sur l'utilisation d'autres @@ -56,13 +56,13 @@ partie pr :ref:`section_examples`. Les utilisateurs intéressés par un accès rapide au module peuvent s'arrêter avant la lecture de la suite, mais un usage utile du module nécessite de lire et de revenir régulièrement aux troisième et septième -parties. Les cinquième et la sixième parties indiquent les -:ref:`section_advanced`, avec l'obtention de renseignements supplémentaires ou -l'usage par scripts d'exécution sans interface utilisateur graphique (GUI), et -une :ref:`section_tui` du module. La septième partie détaille la -:ref:`section_reference`, avec trois sous-parties principales qui suivent. -Enfin, pour respecter les exigences de licence du module, n'oubliez pas de lire -la partie :ref:`section_license`. +parties. La cinquième partie indique les :ref:`section_advanced`, avec +l'obtention de renseignements supplémentaires ou l'usage par scripts d'exécution +sans interface utilisateur graphique (GUI). La partie suivante détaille la +:ref:`section_reference`, avec quatre sous-parties principales qui suivent, la +dernière sous-partie décrivant une :ref:`section_tui` du module. Enfin, pour +respecter les exigences de licence du module, n'oubliez pas de lire la partie +:ref:`section_license`. Dans cette documentation, on utilise les notations standards de l'algèbre linéaire, de l'assimilation de données (comme décrit dans [Ide97]_) et de @@ -83,8 +83,8 @@ Table des mati using examples advanced - tui reference + tui license glossary bibliography diff --git a/doc/fr/ref_algorithm_3DVAR.rst b/doc/fr/ref_algorithm_3DVAR.rst index abea537..47c6580 100644 --- a/doc/fr/ref_algorithm_3DVAR.rst +++ b/doc/fr/ref_algorithm_3DVAR.rst @@ -168,11 +168,12 @@ Les options de l'algorithme sont les suivantes: disponibles à la fin de l'algorithme. Cela implique potentiellement des calculs ou du stockage coûteux. La valeur par défaut est une liste vide, aucune de ces variables n'étant calculée et stockée par défaut. Les noms - possibles sont dans la liste suivante : ["APosterioriCovariance", "BMA", - "CostFunctionJ", "CurrentState", "OMA", "OMB", "Innovation", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtBackground", - "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum", - "SimulationQuantiles"]. + possibles sont dans la liste suivante : ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "OMA", + "OMB", "Innovation", "SigmaObs2", "MahalanobisConsistency", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum", "SimulationQuantiles"]. Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -254,12 +255,30 @@ Les sorties non conditionnelles de l'algorithme sont les suivantes: Les sorties conditionnelles de l'algorithme sont les suivantes: + APosterioriCorrelations + *Liste de matrices*. Chaque élément est une matrice de corrélation des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *Liste de matrices*. Chaque élément est une matrice :math:`\mathbf{A}*` de covariances des erreurs *a posteriori* de l'état optimal. Exemple : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *Liste de matrices*. Chaque élément est une matrice d'écart-types des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *Liste de matrices*. Chaque élément est une matrice de variances des erreurs + *a posteriori* de l'état optimal. + + Exemple : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *Liste de vecteurs*. Chaque élément est un vecteur d'écart entre l'ébauche et l'état optimal. diff --git a/doc/fr/ref_algorithm_Blue.rst b/doc/fr/ref_algorithm_Blue.rst index a748630..45540fa 100644 --- a/doc/fr/ref_algorithm_Blue.rst +++ b/doc/fr/ref_algorithm_Blue.rst @@ -110,10 +110,12 @@ Les options de l'algorithme sont les suivantes: disponibles à la fin de l'algorithme. Cela implique potentiellement des calculs ou du stockage coûteux. La valeur par défaut est une liste vide, aucune de ces variables n'étant calculée et stockée par défaut. Les noms - possibles sont dans la liste suivante : ["APosterioriCovariance", "BMA", - "CostFunctionJ", "OMA", "OMB", "Innovation", "SigmaBck2", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtBackground", - "SimulatedObservationAtOptimum", "SimulationQuantiles"]. + possibles sont dans la liste suivante : ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", + "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", + "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", + "SimulationQuantiles"]. Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -177,12 +179,30 @@ Les sorties non conditionnelles de l'algorithme sont les suivantes: Les sorties conditionnelles de l'algorithme sont les suivantes: + APosterioriCorrelations + *Liste de matrices*. Chaque élément est une matrice de corrélation des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *Liste de matrices*. Chaque élément est une matrice :math:`\mathbf{A}*` de covariances des erreurs *a posteriori* de l'état optimal. Exemple : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *Liste de matrices*. Chaque élément est une matrice d'écart-types des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *Liste de matrices*. Chaque élément est une matrice de variances des erreurs + *a posteriori* de l'état optimal. + + Exemple : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *Liste de vecteurs*. Chaque élément est un vecteur d'écart entre l'ébauche et l'état optimal. diff --git a/doc/fr/ref_algorithm_ExtendedBlue.rst b/doc/fr/ref_algorithm_ExtendedBlue.rst index 6b0b152..e351927 100644 --- a/doc/fr/ref_algorithm_ExtendedBlue.rst +++ b/doc/fr/ref_algorithm_ExtendedBlue.rst @@ -107,10 +107,12 @@ Les options de l'algorithme sont les suivantes: disponibles à la fin de l'algorithme. Cela implique potentiellement des calculs ou du stockage coûteux. La valeur par défaut est une liste vide, aucune de ces variables n'étant calculée et stockée par défaut. Les noms - possibles sont dans la liste suivante : ["APosterioriCovariance", "BMA", - "CostFunctionJ", "OMA", "OMB", "Innovation", "SigmaBck2", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtBackground", - "SimulatedObservationAtOptimum", "SimulationQuantiles"]. + possibles sont dans la liste suivante : ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", + "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", + "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", + "SimulationQuantiles"]. Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -174,12 +176,30 @@ Les sorties non conditionnelles de l'algorithme sont les suivantes: Les sorties conditionnelles de l'algorithme sont les suivantes: + APosterioriCorrelations + *Liste de matrices*. Chaque élément est une matrice de corrélation des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *Liste de matrices*. Chaque élément est une matrice :math:`\mathbf{A}*` de covariances des erreurs *a posteriori* de l'état optimal. Exemple : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *Liste de matrices*. Chaque élément est une matrice d'écart-types des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *Liste de matrices*. Chaque élément est une matrice de variances des erreurs + *a posteriori* de l'état optimal. + + Exemple : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *Liste de vecteurs*. Chaque élément est un vecteur d'écart entre l'ébauche et l'état optimal. diff --git a/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst b/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst index ced362f..6d7cd20 100644 --- a/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst +++ b/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst @@ -115,8 +115,10 @@ Les options de l'algorithme sont les suivantes: disponibles à la fin de l'algorithme. Cela implique potentiellement des calculs ou du stockage coûteux. La valeur par défaut est une liste vide, aucune de ces variables n'étant calculée et stockée par défaut. Les noms - possibles sont dans la liste suivante : ["APosterioriCovariance", "BMA", - "CostFunctionJ", "CurrentState", "Innovation"]. + possibles sont dans la liste suivante : ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", + "Innovation"]. Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -142,12 +144,30 @@ Les sorties non conditionnelles de l'algorithme sont les suivantes: Les sorties conditionnelles de l'algorithme sont les suivantes: + APosterioriCorrelations + *Liste de matrices*. Chaque élément est une matrice de corrélation des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *Liste de matrices*. Chaque élément est une matrice :math:`\mathbf{A}*` de covariances des erreurs *a posteriori* de l'état optimal. Exemple : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *Liste de matrices*. Chaque élément est une matrice d'écart-types des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *Liste de matrices*. Chaque élément est une matrice de variances des erreurs + *a posteriori* de l'état optimal. + + Exemple : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *Liste de vecteurs*. Chaque élément est un vecteur d'écart entre l'ébauche et l'état optimal. diff --git a/doc/fr/ref_algorithm_KalmanFilter.rst b/doc/fr/ref_algorithm_KalmanFilter.rst index e159698..7242a6d 100644 --- a/doc/fr/ref_algorithm_KalmanFilter.rst +++ b/doc/fr/ref_algorithm_KalmanFilter.rst @@ -112,8 +112,10 @@ Les options de l'algorithme sont les suivantes: disponibles à la fin de l'algorithme. Cela implique potentiellement des calculs ou du stockage coûteux. La valeur par défaut est une liste vide, aucune de ces variables n'étant calculée et stockée par défaut. Les noms - possibles sont dans la liste suivante : ["APosterioriCovariance", "BMA", - "CostFunctionJ", "CurrentState", "Innovation"]. + possibles sont dans la liste suivante : ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", + "Innovation"]. Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -139,12 +141,30 @@ Les sorties non conditionnelles de l'algorithme sont les suivantes: Les sorties conditionnelles de l'algorithme sont les suivantes: + APosterioriCorrelations + *Liste de matrices*. Chaque élément est une matrice de corrélation des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *Liste de matrices*. Chaque élément est une matrice :math:`\mathbf{A}*` de covariances des erreurs *a posteriori* de l'état optimal. Exemple : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *Liste de matrices*. Chaque élément est une matrice d'écart-types des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *Liste de matrices*. Chaque élément est une matrice de variances des erreurs + *a posteriori* de l'état optimal. + + Exemple : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *Liste de vecteurs*. Chaque élément est un vecteur d'écart entre l'ébauche et l'état optimal. diff --git a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst index bceef23..eb1e972 100644 --- a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst @@ -162,10 +162,9 @@ Les options de l'algorithme sont les suivantes: disponibles à la fin de l'algorithme. Cela implique potentiellement des calculs ou du stockage coûteux. La valeur par défaut est une liste vide, aucune de ces variables n'étant calculée et stockée par défaut. Les noms - possibles sont dans la liste suivante : ["APosterioriCovariance", "BMA", - "CostFunctionJ", "CurrentState", "OMA", "OMB", "Innovation", "SigmaObs2", - "MahalanobisConsistency", "SimulatedObservationAtCurrentState", - "SimulatedObservationAtOptimum"]. + possibles sont dans la liste suivante : ["BMA", "CostFunctionJ", + "CurrentState", "OMA", "OMB", "Innovation", + "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` diff --git a/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst b/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst index 50dc661..1a99e1c 100644 --- a/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst +++ b/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst @@ -130,8 +130,10 @@ Les options de l'algorithme sont les suivantes: disponibles à la fin de l'algorithme. Cela implique potentiellement des calculs ou du stockage coûteux. La valeur par défaut est une liste vide, aucune de ces variables n'étant calculée et stockée par défaut. Les noms - possibles sont dans la liste suivante : ["APosterioriCovariance", "BMA", - "CostFunctionJ", "CurrentState", "Innovation"]. + possibles sont dans la liste suivante : ["APosterioriCorrelations", + "APosterioriCovariance", "APosterioriStandardDeviations", + "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", + "Innovation"]. Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` @@ -157,12 +159,30 @@ Les sorties non conditionnelles de l'algorithme sont les suivantes: Les sorties conditionnelles de l'algorithme sont les suivantes: + APosterioriCorrelations + *Liste de matrices*. Chaque élément est une matrice de corrélation des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``C = ADD.get("APosterioriCorrelations")[-1]`` + APosterioriCovariance *Liste de matrices*. Chaque élément est une matrice :math:`\mathbf{A}*` de covariances des erreurs *a posteriori* de l'état optimal. Exemple : ``A = ADD.get("APosterioriCovariance")[-1]`` + APosterioriStandardDeviations + *Liste de matrices*. Chaque élément est une matrice d'écart-types des + erreurs *a posteriori* de l'état optimal. + + Exemple : ``E = ADD.get("APosterioriStandardDeviations")[-1]`` + + APosterioriVariances + *Liste de matrices*. Chaque élément est une matrice de variances des erreurs + *a posteriori* de l'état optimal. + + Exemple : ``V = ADD.get("APosterioriVariances")[-1]`` + BMA *Liste de vecteurs*. Chaque élément est un vecteur d'écart entre l'ébauche et l'état optimal. diff --git a/src/daComposant/daAlgorithms/3DVAR.py b/src/daComposant/daAlgorithms/3DVAR.py index cd3bedd..a4a475c 100644 --- a/src/daComposant/daAlgorithms/3DVAR.py +++ b/src/daComposant/daAlgorithms/3DVAR.py @@ -72,7 +72,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["APosterioriCovariance", "BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "Innovation", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "Innovation", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"] ) self.defineRequiredParameter( name = "Quantiles", diff --git a/src/daComposant/daAlgorithms/Blue.py b/src/daComposant/daAlgorithms/Blue.py index d3ca8c0..7600ea5 100644 --- a/src/daComposant/daAlgorithms/Blue.py +++ b/src/daComposant/daAlgorithms/Blue.py @@ -39,7 +39,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["APosterioriCovariance", "BMA", "OMA", "OMB", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum"] ) self.defineRequiredParameter( name = "Quantiles", diff --git a/src/daComposant/daAlgorithms/ExtendedBlue.py b/src/daComposant/daAlgorithms/ExtendedBlue.py index ea93f62..eb1fc59 100644 --- a/src/daComposant/daAlgorithms/ExtendedBlue.py +++ b/src/daComposant/daAlgorithms/ExtendedBlue.py @@ -39,7 +39,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["APosterioriCovariance", "BMA", "OMA", "OMB", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum"] ) self.defineRequiredParameter( name = "Quantiles", diff --git a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py index b0b4670..f9e2c81 100644 --- a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py @@ -53,7 +53,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["APosterioriCovariance", "BMA", "CurrentState", "CostFunctionJ", "Innovation"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "CurrentState", "CostFunctionJ", "Innovation"] ) self.defineRequiredParameter( # Pas de type name = "Bounds", diff --git a/src/daComposant/daAlgorithms/KalmanFilter.py b/src/daComposant/daAlgorithms/KalmanFilter.py index cc267e5..d1d50b9 100644 --- a/src/daComposant/daAlgorithms/KalmanFilter.py +++ b/src/daComposant/daAlgorithms/KalmanFilter.py @@ -46,7 +46,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["APosterioriCovariance", "BMA", "CurrentState", "CostFunctionJ", "Innovation"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "CurrentState", "CostFunctionJ", "Innovation"] ) def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None): diff --git a/src/daComposant/daAlgorithms/ObserverTest.py b/src/daComposant/daAlgorithms/ObserverTest.py index a49a202..4f1007c 100644 --- a/src/daComposant/daAlgorithms/ObserverTest.py +++ b/src/daComposant/daAlgorithms/ObserverTest.py @@ -52,6 +52,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): self.StoredVariables["CostFunctionJ" ].store( 3. ) # self.StoredVariables["APosterioriCovariance"].store( numpy.diag(__Xa) ) + self.StoredVariables["APosterioriVariances"].store( __Xa ) + self.StoredVariables["APosterioriStandardDeviations"].store( __Xa ) + self.StoredVariables["APosterioriCorrelations"].store( numpy.diag(__Xa) ) self.StoredVariables["BMA"].store( __Xb - __Xa ) self.StoredVariables["OMA"].store( __YY ) self.StoredVariables["OMB"].store( __YY ) diff --git a/src/daComposant/daAlgorithms/SamplingTest.py b/src/daComposant/daAlgorithms/SamplingTest.py index 7856b23..67cfa2d 100644 --- a/src/daComposant/daAlgorithms/SamplingTest.py +++ b/src/daComposant/daAlgorithms/SamplingTest.py @@ -105,7 +105,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if len(dim) != 3: raise ValueError("For dimension %i, the variable definition \"%s\" is incorrect, it should be [min,max,step]."%(i,dim)) else: - coordinatesList.append(numpy.linspace(*dim)) + coordinatesList.append(numpy.linspace(dim[0],dim[1],1+int(float(dim[1])-float(dim[0])/float(dim[2])))) sampleList = itertools.product(*coordinatesList) elif len(self._parameters["SampleAsIndependantRandomVariables"]) > 0: coordinatesList = [] diff --git a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py index d0f9590..7cfeeca 100644 --- a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py @@ -82,7 +82,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["APosterioriCovariance", "BMA", "CurrentState", "CostFunctionJ", "Innovation"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "CurrentState", "CostFunctionJ", "Innovation"] ) self.defineRequiredParameter( # Pas de type name = "Bounds", diff --git a/src/daComposant/daCore/BasicObjects.py b/src/daComposant/daCore/BasicObjects.py index f803520..f0b7414 100644 --- a/src/daComposant/daCore/BasicObjects.py +++ b/src/daComposant/daCore/BasicObjects.py @@ -273,6 +273,9 @@ class Algorithm: - OMB : Observation moins Background : Y - Xb - AMB : Analysis moins Background : Xa - Xb - APosterioriCovariance : matrice A + - APosterioriVariances : variances de la matrice A + - APosterioriStandardDeviations : écart-types de la matrice A + - APosterioriCorrelations : correlations de la matrice A On peut rajouter des variables à stocker dans l'initialisation de l'algorithme élémentaire qui va hériter de cette classe """ @@ -303,6 +306,9 @@ class Algorithm: self.StoredVariables["OMB"] = Persistence.OneVector(name = "OMB") self.StoredVariables["BMA"] = Persistence.OneVector(name = "BMA") self.StoredVariables["APosterioriCovariance"] = Persistence.OneMatrix(name = "APosterioriCovariance") + self.StoredVariables["APosterioriVariances"] = Persistence.OneVector(name = "APosterioriVariances") + self.StoredVariables["APosterioriStandardDeviations"] = Persistence.OneVector(name = "APosterioriStandardDeviations") + self.StoredVariables["APosterioriCorrelations"] = Persistence.OneMatrix(name = "APosterioriCorrelations") self.StoredVariables["SimulationQuantiles"] = Persistence.OneMatrix(name = "SimulationQuantiles") def _pre_run(self): @@ -311,6 +317,17 @@ class Algorithm: return 0 def _post_run(self,_oH=None): + if self._parameters.has_key("StoreSupplementaryCalculations") and \ + "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]: + for _A in self.StoredVariables["APosterioriCovariance"]: + if "APosterioriVariances" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["APosterioriVariances"].store( numpy.diag(_A) ) + if "APosterioriStandardDeviations" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["APosterioriStandardDeviations"].store( numpy.sqrt(numpy.diag(_A)) ) + if "APosterioriCorrelations" in self._parameters["StoreSupplementaryCalculations"]: + _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: 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))) diff --git a/src/daComposant/daNumerics/ApproximatedDerivatives.py b/src/daComposant/daNumerics/ApproximatedDerivatives.py index 798a9a4..7133440 100644 --- a/src/daComposant/daNumerics/ApproximatedDerivatives.py +++ b/src/daComposant/daNumerics/ApproximatedDerivatives.py @@ -71,6 +71,8 @@ class FDApproximation(object): else: self.__mpEnabled = False self.__mpWorkers = mpWorkers + if self.__mpWorkers is not None and self.__mpWorkers < 1: + self.__mpWorkers = None logging.debug("FDA Calculs en multiprocessing : %s (nombre de processus : %s)"%(self.__mpEnabled,self.__mpWorkers)) # if self.__mpEnabled: diff --git a/src/daEficas/generator_adao.py b/src/daEficas/generator_adao.py index ef5e48e..64a35fe 100644 --- a/src/daEficas/generator_adao.py +++ b/src/daEficas/generator_adao.py @@ -221,6 +221,8 @@ class AdaoGenerator(PythonGenerator): self.text_da += data_name + "_ScriptWithOneFunction['CenteredFiniteDifference'] = " + str(self.dictMCVal[search_type + "SCRIPTWITHONEFUNCTION_DATA__CenteredFiniteDifference"]) + "\n" if search_type + "SCRIPTWITHONEFUNCTION_DATA__EnableMultiProcessing" in self.dictMCVal.keys(): self.text_da += data_name + "_ScriptWithOneFunction['EnableMultiProcessing'] = " + str(self.dictMCVal[search_type + "SCRIPTWITHONEFUNCTION_DATA__EnableMultiProcessing"]) + "\n" + if search_type + "SCRIPTWITHONEFUNCTION_DATA__NumberOfProcesses" in self.dictMCVal.keys(): + self.text_da += data_name + "_ScriptWithOneFunction['NumberOfProcesses'] = " + str(self.dictMCVal[search_type + "SCRIPTWITHONEFUNCTION_DATA__NumberOfProcesses"]) + "\n" self.text_da += data_name + "_config = {}\n" self.text_da += data_name + "_config['Type'] = 'Function'\n" self.text_da += data_name + "_config['From'] = 'ScriptWithOneFunction'\n" diff --git a/src/daSalome/daYacsIntegration/daOptimizerLoop.py b/src/daSalome/daYacsIntegration/daOptimizerLoop.py index 2e40cce..7f29385 100644 --- a/src/daSalome/daYacsIntegration/daOptimizerLoop.py +++ b/src/daSalome/daYacsIntegration/daOptimizerLoop.py @@ -349,7 +349,7 @@ class AssimilationAlgorithm_asynch(SALOMERuntime.OptimizerAlgASync): except Exception as e: if type(e) == type(SyntaxError()): msg = "at %s: %s"%(e.offset, e.text) else: msg = "" - raise ValueError("during analyse, the following error occurs:\n\n%s %s\n\nSee also the potential messages, which can show the origin of the above error, in the YACS GUI or in the launching terminal."%(str(e),msg)) + raise ValueError("during execution, the following error occurs:\n\n%s %s\n\nSee also the potential messages, which can show the origin of the above error, in the YACS GUI or in the launching terminal."%(str(e),msg)) # Assimilation Study is finished self.pool.destroyAll() diff --git a/src/daSalome/daYacsSchemaCreator/infos_daComposant.py b/src/daSalome/daYacsSchemaCreator/infos_daComposant.py index 0aed5da..457fc0b 100644 --- a/src/daSalome/daYacsSchemaCreator/infos_daComposant.py +++ b/src/daSalome/daYacsSchemaCreator/infos_daComposant.py @@ -259,5 +259,8 @@ ObserversList = [ "GradientOfCostFunctionJo", "SigmaObs2", "SigmaBck2", + "APosterioriCorrelations", "APosterioriCovariance", + "APosterioriStandardDeviations", + "APosterioriVariances", ] diff --git a/src/daSalome/daYacsSchemaCreator/methods.py b/src/daSalome/daYacsSchemaCreator/methods.py index f796239..8b662a1 100644 --- a/src/daSalome/daYacsSchemaCreator/methods.py +++ b/src/daSalome/daYacsSchemaCreator/methods.py @@ -543,6 +543,8 @@ def create_yacs_proc(study_config): node_script += """ centeredDF = %s,\n"""%str(ScriptWithOneFunction['CenteredFiniteDifference']) if 'EnableMultiProcessing' in ScriptWithOneFunction.keys(): node_script += """ mpEnabled = %s,\n"""%str(ScriptWithOneFunction['EnableMultiProcessing']) + if 'NumberOfProcesses' in ScriptWithOneFunction.keys(): + node_script += """ mpWorkers = %s,\n"""%str(ScriptWithOneFunction['NumberOfProcesses']) node_script += """ )\n""" node_script += """#\n""" node_script += """__data = []\n""" @@ -738,6 +740,8 @@ def create_yacs_proc(study_config): node_script += """ centeredDF = %s,\n"""%str(ScriptWithOneFunction['CenteredFiniteDifference']) if 'EnableMultiProcessing' in ScriptWithOneFunction.keys(): node_script += """ mpEnabled = %s,\n"""%str(ScriptWithOneFunction['EnableMultiProcessing']) + if 'NumberOfProcesses' in ScriptWithOneFunction.keys(): + node_script += """ mpWorkers = %s,\n"""%str(ScriptWithOneFunction['NumberOfProcesses']) node_script += """ )\n""" node_script += """#\n""" node_script += """__data = []\n""" -- 2.39.2