From d17fb7c98cbe65531e870b75a52bb709422f188b Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Fri, 8 May 2015 17:59:07 +0200 Subject: [PATCH] Documentation and source improvements --- doc/en/ref_algorithm_3DVAR.rst | 2 +- doc/en/ref_algorithm_Blue.rst | 11 ++++---- doc/en/ref_algorithm_EnsembleBlue.rst | 11 ++++++++ doc/en/ref_algorithm_ExtendedBlue.rst | 11 ++++---- doc/en/ref_algorithm_ExtendedKalmanFilter.rst | 2 +- doc/en/ref_algorithm_KalmanFilter.rst | 2 +- doc/en/ref_algorithm_LinearLeastSquares.rst | 6 ++--- .../ref_algorithm_NonLinearLeastSquares.rst | 2 +- ...ef_algorithm_ParticleSwarmOptimization.rst | 2 +- doc/en/ref_algorithm_QuantileRegression.rst | 2 +- doc/en/ref_algorithm_SamplingTest.rst | 6 ++++- .../ref_algorithm_UnscentedKalmanFilter.rst | 2 +- doc/en/reference.rst | 12 ++++----- doc/fr/ref_algorithm_3DVAR.rst | 2 +- doc/fr/ref_algorithm_Blue.rst | 11 ++++---- doc/fr/ref_algorithm_EnsembleBlue.rst | 11 ++++++++ doc/fr/ref_algorithm_ExtendedBlue.rst | 13 ++++------ doc/fr/ref_algorithm_ExtendedKalmanFilter.rst | 2 +- doc/fr/ref_algorithm_KalmanFilter.rst | 2 +- doc/fr/ref_algorithm_LinearLeastSquares.rst | 5 ++-- .../ref_algorithm_NonLinearLeastSquares.rst | 2 +- ...ef_algorithm_ParticleSwarmOptimization.rst | 2 +- doc/fr/ref_algorithm_QuantileRegression.rst | 4 +-- doc/fr/ref_algorithm_SamplingTest.rst | 7 +++++- .../ref_algorithm_UnscentedKalmanFilter.rst | 2 +- doc/fr/ref_output_variables.rst | 2 +- doc/fr/reference.rst | 12 ++++----- doc/fr/tui.rst | 25 ++++++++++--------- src/daComposant/daAlgorithms/3DVAR.py | 2 +- src/daComposant/daAlgorithms/Blue.py | 21 ++++++++++------ src/daComposant/daAlgorithms/EnsembleBlue.py | 25 +++++++++++++++++-- src/daComposant/daAlgorithms/ExtendedBlue.py | 23 ++++++++++------- .../daAlgorithms/LinearLeastSquares.py | 6 ++++- src/daComposant/daCore/BasicObjects.py | 4 +-- 34 files changed, 161 insertions(+), 93 deletions(-) diff --git a/doc/en/ref_algorithm_3DVAR.rst b/doc/en/ref_algorithm_3DVAR.rst index a946bbb..3dce275 100644 --- a/doc/en/ref_algorithm_3DVAR.rst +++ b/doc/en/ref_algorithm_3DVAR.rst @@ -170,7 +170,7 @@ The options of the algorithm are the following: "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum", "SimulationQuantiles"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Quantiles This list indicates the values of quantile, between 0 and 1, to be estimated diff --git a/doc/en/ref_algorithm_Blue.rst b/doc/en/ref_algorithm_Blue.rst index da5e64b..d64f77e 100644 --- a/doc/en/ref_algorithm_Blue.rst +++ b/doc/en/ref_algorithm_Blue.rst @@ -110,12 +110,13 @@ The options of the algorithm are the following: these variables being calculated and stored by default. The possible names are in the following list: ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", - "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", - "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", - "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", - "SimulationQuantiles"]. + "APosterioriVariances", "BMA", "OMA", "OMB", "CurrentState", + "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", + "MahalanobisConsistency", "SimulationQuantiles", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Quantiles This list indicates the values of quantile, between 0 and 1, to be estimated diff --git a/doc/en/ref_algorithm_EnsembleBlue.rst b/doc/en/ref_algorithm_EnsembleBlue.rst index b7ff885..41bdc7c 100644 --- a/doc/en/ref_algorithm_EnsembleBlue.rst +++ b/doc/en/ref_algorithm_EnsembleBlue.rst @@ -96,6 +96,17 @@ command. The options of the algorithm are the following: + StoreSupplementaryCalculations + This list indicates the names of the supplementary variables that can be + 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: ["CurrentState", "Innovation", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum"]. + + Example : ``{"StoreSupplementaryCalculations":["CurrentState", "Innovation"]}`` + SetSeed This key allow to give an integer in order to fix the seed of the random generator used to generate the ensemble. A convenient value is for example diff --git a/doc/en/ref_algorithm_ExtendedBlue.rst b/doc/en/ref_algorithm_ExtendedBlue.rst index 675adc0..fb4e893 100644 --- a/doc/en/ref_algorithm_ExtendedBlue.rst +++ b/doc/en/ref_algorithm_ExtendedBlue.rst @@ -108,12 +108,13 @@ The options of the algorithm are the following: these variables being calculated and stored by default. The possible names are in the following list: ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", - "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", - "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", - "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", - "SimulationQuantiles"]. + "APosterioriVariances", "BMA", "OMA", "OMB", "CurrentState", + "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", + "MahalanobisConsistency", "SimulationQuantiles", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Quantiles This list indicates the values of quantile, between 0 and 1, to be estimated diff --git a/doc/en/ref_algorithm_ExtendedKalmanFilter.rst b/doc/en/ref_algorithm_ExtendedKalmanFilter.rst index 2ea62c3..9619316 100644 --- a/doc/en/ref_algorithm_ExtendedKalmanFilter.rst +++ b/doc/en/ref_algorithm_ExtendedKalmanFilter.rst @@ -117,7 +117,7 @@ The options of the algorithm are the following: "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "Innovation"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Information and variables available at the end of the algorithm +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/en/ref_algorithm_KalmanFilter.rst b/doc/en/ref_algorithm_KalmanFilter.rst index c40a407..671d29c 100644 --- a/doc/en/ref_algorithm_KalmanFilter.rst +++ b/doc/en/ref_algorithm_KalmanFilter.rst @@ -116,7 +116,7 @@ The options of the algorithm are the following: "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "Innovation"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Information and variables available at the end of the algorithm +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/en/ref_algorithm_LinearLeastSquares.rst b/doc/en/ref_algorithm_LinearLeastSquares.rst index 29e186d..2b04ae4 100644 --- a/doc/en/ref_algorithm_LinearLeastSquares.rst +++ b/doc/en/ref_algorithm_LinearLeastSquares.rst @@ -93,10 +93,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: ["OMA", "CostFunctionJ", - "SimulatedObservationAtOptimum"]. + are in the following list: ["OMA", "CurrentState", "CostFunctionJ", + "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. - Example : ``{"StoreSupplementaryCalculations":["OMA"]}`` + Example : ``{"StoreSupplementaryCalculations":["OMA", "CurrentState"]}`` *Tips for this algorithm:* diff --git a/doc/en/ref_algorithm_NonLinearLeastSquares.rst b/doc/en/ref_algorithm_NonLinearLeastSquares.rst index 6c2b520..f64f798 100644 --- a/doc/en/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/en/ref_algorithm_NonLinearLeastSquares.rst @@ -159,7 +159,7 @@ The options of the algorithm are the following: "OMB", "Innovation", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` *Tips for this algorithm:* diff --git a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst index e1eca53..ff117b4 100644 --- a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst @@ -164,7 +164,7 @@ The options of the algorithm are the following: "OMB", "Innovation", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Information and variables available at the end of the algorithm +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/en/ref_algorithm_QuantileRegression.rst b/doc/en/ref_algorithm_QuantileRegression.rst index c8a417d..06f777a 100644 --- a/doc/en/ref_algorithm_QuantileRegression.rst +++ b/doc/en/ref_algorithm_QuantileRegression.rst @@ -112,7 +112,7 @@ The options of the algorithm are the following: "OMB", "Innovation", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` *Tips for this algorithm:* diff --git a/doc/en/ref_algorithm_SamplingTest.rst b/doc/en/ref_algorithm_SamplingTest.rst index baf16fa..7996b55 100644 --- a/doc/en/ref_algorithm_SamplingTest.rst +++ b/doc/en/ref_algorithm_SamplingTest.rst @@ -45,7 +45,11 @@ the form of hyper-cubes, explicit or sampled using classic distributions. Be careful to the size of the hyper-cube (and then to the number of calculations) that can be reached, it can be big very quickly. -To perform distributed or complex sampling, see other modules available in +To be visible by the user, the results of sampling has to be explicitly asked +for. One use for that, on the desired variable, the final saving through +"*UserPostAnalysis*" or the treatment during the calculation by "*observer*". + +To perform distributed or more complex sampling, see other modules available in SALOME : PARAMETRIC or OPENTURNS. Optional and required commands diff --git a/doc/en/ref_algorithm_UnscentedKalmanFilter.rst b/doc/en/ref_algorithm_UnscentedKalmanFilter.rst index e903aa6..9512bdb 100644 --- a/doc/en/ref_algorithm_UnscentedKalmanFilter.rst +++ b/doc/en/ref_algorithm_UnscentedKalmanFilter.rst @@ -132,7 +132,7 @@ The options of the algorithm are the following: "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "Innovation"]. - Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Information and variables available at the end of the algorithm +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 845f14b..9955521 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -80,16 +80,16 @@ The mathematical notations used afterward are explained in the section ref_assimilation_keywords ref_algorithm_3DVAR - ref_algorithm_LinearLeastSquares - ref_algorithm_NonLinearLeastSquares ref_algorithm_Blue - ref_algorithm_ExtendedBlue ref_algorithm_EnsembleBlue - ref_algorithm_KalmanFilter + ref_algorithm_ExtendedBlue ref_algorithm_ExtendedKalmanFilter - ref_algorithm_UnscentedKalmanFilter + ref_algorithm_KalmanFilter + ref_algorithm_LinearLeastSquares + ref_algorithm_NonLinearLeastSquares ref_algorithm_ParticleSwarmOptimization ref_algorithm_QuantileRegression + ref_algorithm_UnscentedKalmanFilter .. _section_reference_checking: @@ -114,5 +114,5 @@ The mathematical notations used afterward are explained in the section ref_algorithm_GradientTest ref_algorithm_LinearityTest ref_algorithm_ObserverTest - ref_algorithm_TangentTest ref_algorithm_SamplingTest + ref_algorithm_TangentTest diff --git a/doc/fr/ref_algorithm_3DVAR.rst b/doc/fr/ref_algorithm_3DVAR.rst index 47c6580..fa5e425 100644 --- a/doc/fr/ref_algorithm_3DVAR.rst +++ b/doc/fr/ref_algorithm_3DVAR.rst @@ -175,7 +175,7 @@ Les options de l'algorithme sont les suivantes: "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum", "SimulationQuantiles"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Quantiles Cette liste indique les valeurs de quantile, entre 0 et 1, à estimer par diff --git a/doc/fr/ref_algorithm_Blue.rst b/doc/fr/ref_algorithm_Blue.rst index 45540fa..f862141 100644 --- a/doc/fr/ref_algorithm_Blue.rst +++ b/doc/fr/ref_algorithm_Blue.rst @@ -112,12 +112,13 @@ Les options de l'algorithme sont les suivantes: aucune de ces variables n'étant calculée et stockée par défaut. Les noms possibles sont dans la liste suivante : ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", - "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", - "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", - "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", - "SimulationQuantiles"]. + "APosterioriVariances", "BMA", "OMA", "OMB", "CurrentState", + "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", + "MahalanobisConsistency", "SimulationQuantiles", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Quantiles Cette liste indique les valeurs de quantile, entre 0 et 1, à estimer par diff --git a/doc/fr/ref_algorithm_EnsembleBlue.rst b/doc/fr/ref_algorithm_EnsembleBlue.rst index d8add0d..04b7c02 100644 --- a/doc/fr/ref_algorithm_EnsembleBlue.rst +++ b/doc/fr/ref_algorithm_EnsembleBlue.rst @@ -97,6 +97,17 @@ commande. Les options de l'algorithme sont les suivantes: + StoreSupplementaryCalculations + Cette liste indique les noms des variables supplémentaires qui peuvent être + 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 : ["CurrentState", "Innovation", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum"]. + + Exemple : ``{"StoreSupplementaryCalculations":["CurrentState", "Innovation"]}`` + SetSeed Cette clé permet de donner un nombre entier pour fixer la graine du générateur aléatoire utilisé pour générer l'ensemble. Un valeur pratique est diff --git a/doc/fr/ref_algorithm_ExtendedBlue.rst b/doc/fr/ref_algorithm_ExtendedBlue.rst index e351927..ffbe23e 100644 --- a/doc/fr/ref_algorithm_ExtendedBlue.rst +++ b/doc/fr/ref_algorithm_ExtendedBlue.rst @@ -107,14 +107,11 @@ 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 : ["APosterioriCorrelations", - "APosterioriCovariance", "APosterioriStandardDeviations", - "APosterioriVariances", "BMA", "CostFunctionJ", "OMA", "OMB", "Innovation", - "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", - "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum", - "SimulationQuantiles"]. - - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + possibles sont dans la liste suivante : ["CurrentState", "Innovation", + "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", + "SimulatedObservationAtOptimum"]. + + Exemple : ``{"StoreSupplementaryCalculations":["CurrentState", "Innovation"]}`` Quantiles Cette liste indique les valeurs de quantile, entre 0 et 1, à estimer par diff --git a/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst b/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst index 6d7cd20..4cc49b3 100644 --- a/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst +++ b/doc/fr/ref_algorithm_ExtendedKalmanFilter.rst @@ -120,7 +120,7 @@ Les options de l'algorithme sont les suivantes: "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "Innovation"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Informations et variables disponibles à la fin de l'algorithme ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/fr/ref_algorithm_KalmanFilter.rst b/doc/fr/ref_algorithm_KalmanFilter.rst index 7242a6d..ef4872c 100644 --- a/doc/fr/ref_algorithm_KalmanFilter.rst +++ b/doc/fr/ref_algorithm_KalmanFilter.rst @@ -117,7 +117,7 @@ Les options de l'algorithme sont les suivantes: "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "Innovation"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Informations et variables disponibles à la fin de l'algorithme ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/fr/ref_algorithm_LinearLeastSquares.rst b/doc/fr/ref_algorithm_LinearLeastSquares.rst index 89669b1..1b754ed 100644 --- a/doc/fr/ref_algorithm_LinearLeastSquares.rst +++ b/doc/fr/ref_algorithm_LinearLeastSquares.rst @@ -94,10 +94,11 @@ 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 : ["OMA", "CostFunctionJ", + possibles sont dans la liste suivante : ["OMA", "CurrentState", + "CostFunctionJ", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. - Exemple : ``{"StoreSupplementaryCalculations":["OMA"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["OMA", "CurrentState"]}`` *Astuce pour cet algorithme :* diff --git a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst index eb1e972..5f4e708 100644 --- a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst @@ -166,7 +166,7 @@ Les options de l'algorithme sont les suivantes: "CurrentState", "OMA", "OMB", "Innovation", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` *Astuce pour cet algorithme :* diff --git a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst index a7320c4..98a67eb 100644 --- a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst @@ -169,7 +169,7 @@ Les options de l'algorithme sont les suivantes: "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Informations et variables disponibles à la fin de l'algorithme ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/fr/ref_algorithm_QuantileRegression.rst b/doc/fr/ref_algorithm_QuantileRegression.rst index dd6fe00..6ae741a 100644 --- a/doc/fr/ref_algorithm_QuantileRegression.rst +++ b/doc/fr/ref_algorithm_QuantileRegression.rst @@ -112,9 +112,9 @@ Les options de l'algorithme sont les suivantes: possibles sont dans la liste suivante : ["BMA", "CostFunctionJ", "CurrentState", "OMA", "OMB", "Innovation", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", - "SimulatedObservationAtOptimum"]. + "SimulatedObservationAtOptimum"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` *Astuce pour cet algorithme :* diff --git a/doc/fr/ref_algorithm_SamplingTest.rst b/doc/fr/ref_algorithm_SamplingTest.rst index e16b997..ec3d412 100644 --- a/doc/fr/ref_algorithm_SamplingTest.rst +++ b/doc/fr/ref_algorithm_SamplingTest.rst @@ -46,7 +46,12 @@ sous la forme d'hyper-cubes, explicites ou courantes. Attention à la taille de l'hyper-cube (et donc au nombre de calculs) qu'il est possible d'atteindre, elle peut rapidement devenir importante. -Pour effectuer un échantillonage distribué ou plus complexe, voir d'autres +Pour apparaître pour l'utilisateur, les résultats de l'échantillonnage doivent +être demandés explicitement. On utilise pour cela, sur la variable désirée, la +sauvegarde finale à l'aide du mot-clé "*UserPostAnalysis*" ou le traitement en +cours de calcul à l'aide des "*observer*" adaptés. + +Pour effectuer un échantillonnage distribué ou plus complexe, voir d'autres modules disponibles dans SALOME : PARAMETRIC ou OPENTURNS. Commandes requises et optionnelles diff --git a/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst b/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst index 1a99e1c..87b5b1a 100644 --- a/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst +++ b/doc/fr/ref_algorithm_UnscentedKalmanFilter.rst @@ -135,7 +135,7 @@ Les options de l'algorithme sont les suivantes: "APosterioriVariances", "BMA", "CostFunctionJ", "CurrentState", "Innovation"]. - Exemple : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}`` + Exemple : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}`` Informations et variables disponibles à la fin de l'algorithme ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/fr/ref_output_variables.rst b/doc/fr/ref_output_variables.rst index 1f7e64a..47bb2b4 100644 --- a/doc/fr/ref_output_variables.rst +++ b/doc/fr/ref_output_variables.rst @@ -41,7 +41,7 @@ calcul. L'obtention de ces informations se fait ensuite de mani à l'aide de l'étape de post-processing du calcul. L'étape est aisément identifiée par l'utilisateur dans son cas ADAO de -définition (par la mot-clé "*UserPostAnalysis*") ou dans son schéma YACS +définition (par le mot-clé "*UserPostAnalysis*") ou dans son schéma YACS d'exécution (par des noeuds ou blocs situés après le bloc de calcul, et reliés graphiquement au port de sortie "*algoResults*" du bloc de calcul): diff --git a/doc/fr/reference.rst b/doc/fr/reference.rst index 2ff6066..d74f1dd 100644 --- a/doc/fr/reference.rst +++ b/doc/fr/reference.rst @@ -82,16 +82,16 @@ ADAO. Les notations math ref_assimilation_keywords ref_algorithm_3DVAR - ref_algorithm_LinearLeastSquares - ref_algorithm_NonLinearLeastSquares ref_algorithm_Blue - ref_algorithm_ExtendedBlue ref_algorithm_EnsembleBlue - ref_algorithm_KalmanFilter + ref_algorithm_ExtendedBlue ref_algorithm_ExtendedKalmanFilter - ref_algorithm_UnscentedKalmanFilter + ref_algorithm_KalmanFilter + ref_algorithm_LinearLeastSquares + ref_algorithm_NonLinearLeastSquares ref_algorithm_ParticleSwarmOptimization ref_algorithm_QuantileRegression + ref_algorithm_UnscentedKalmanFilter .. _section_reference_checking: @@ -116,5 +116,5 @@ ADAO. Les notations math ref_algorithm_GradientTest ref_algorithm_LinearityTest ref_algorithm_ObserverTest - ref_algorithm_TangentTest ref_algorithm_SamplingTest + ref_algorithm_TangentTest diff --git a/doc/fr/tui.rst b/doc/fr/tui.rst index 2c2ec07..5e808ae 100644 --- a/doc/fr/tui.rst +++ b/doc/fr/tui.rst @@ -208,10 +208,10 @@ de mani en TUI. Les variables de résultats de calcul, ou les variables internes issues de -l'optimisation sont disponibles à travers la méthode ``get`` du cas de calcul TUI -ADAO, qui renvoie un objet de type liste de la variable demandée. On se -reportera aux :ref:`section_ref_output_variables` pour une description détaillée -sur ce sujet. +l'optimisation ou de l'assimilation de données, sont disponibles à travers la +méthode ``get`` du cas de calcul TUI ADAO, qui renvoie un objet de type liste de +la variable demandée. On se reportera aux :ref:`section_ref_output_variables` +pour une description détaillée sur ce sujet. A titre d'exemple, on donne quelques lignes de script qui permettent d'obtenir le nombre d'itérations de l'optimisation et la valeur optimale ainsi que sa @@ -220,7 +220,7 @@ taille:: print print " Nombre d'iterations :", len(case.get("CostFunctionJ")) Xa = case.get("Analysis") - print " Analyse optimale :", Xa[-1] + print " Analyse optimale :", Xa[-1] print " Taille de l'analyse :", len(Xa[-1]) print @@ -228,9 +228,10 @@ Ces lignes peuvent de calcul TUI ADAO proposé dans :ref:`subsection_tui_example`. De même que pour l'entrée des données, la simplicité de récupération des -résultats permet d'envisager aisément des post-traitements enchaînés, pour -utiliser par exemple de la visualisation avec MatPlotLib ou PARAVIS [PARAVIS]_, -de l'adaptation de maillage avec HOMARD [HOMARD]_, ou pour d'autres calculs. +résultats permet d'envisager aisément des post-traitements enchaînés dans +SALOME, pour utiliser par exemple de la visualisation avec MatPlotLib ou PARAVIS +[PARAVIS]_, de l'adaptation de maillage avec HOMARD [HOMARD]_, ou pour d'autres +calculs. .. _subsection_tui_commands: @@ -548,10 +549,10 @@ ici, puisque d Les hypothèses du cas utilisateur sont les suivantes. On suppose : -#. que l'on veut recaler 3 paramètres ``alpha``, ``beta`` et ``gamma`` dans un domaine borné, -#. que l'on dispose d'observations nommées ``observations``, -#. que l'utilisateur dispose en Python d'une fonction de simulation physique appellée ``simulation`` préalablement testée, qui transforme les 3 paramètres en résultats similaires aux observations, -#. que l'exploitation indépendante, que l'utilisateur veut faire, est représentée ici par l'affichage simple de l'état initial, de l'état optimal, de la simulation en ce point, des états intermédiaires et du nombre d'itérations d'optimisation. +#. que l'on veut recaler 3 paramètres ``alpha``, ``beta`` et ``gamma`` dans un domaine borné, +#. que l'on dispose d'observations nommées ``observations``, +#. que l'utilisateur dispose en Python d'une fonction de simulation physique appellée ``simulation`` préalablement testée, qui transforme les 3 paramètres en résultats similaires aux observations, +#. que l'exploitation indépendante, que l'utilisateur veut faire, est représentée ici par l'affichage simple de l'état initial, de l'état optimal, de la simulation en ce point, des états intermédiaires et du nombre d'itérations d'optimisation. Pour effectuer de manière simple cet essai de cas de calcul TUI, on se donne par exemple les entrées suivantes, parfaitement arbitraires, en construisant les diff --git a/src/daComposant/daAlgorithms/3DVAR.py b/src/daComposant/daAlgorithms/3DVAR.py index a7e2e3c..382f12a 100644 --- a/src/daComposant/daAlgorithms/3DVAR.py +++ b/src/daComposant/daAlgorithms/3DVAR.py @@ -320,7 +320,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["MahalanobisConsistency"].store( float( 2.*MinJ/d.size ) ) if "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: - Qtls = self._parameters["Quantiles"] + Qtls = map(float, self._parameters["Quantiles"]) nech = self._parameters["NumberOfSamplesForQuantiles"] HXa = numpy.matrix(numpy.ravel( HXa )).T YfQ = None diff --git a/src/daComposant/daAlgorithms/Blue.py b/src/daComposant/daAlgorithms/Blue.py index 7600ea5..7e05f14 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 = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"] ) self.defineRequiredParameter( name = "Quantiles", @@ -127,12 +127,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Calcul de la fonction coût # -------------------------- if self._parameters["StoreInternalVariables"] or \ - "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \ - "OMA" in self._parameters["StoreSupplementaryCalculations"] or \ - "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \ - "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"] or \ - "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"] or \ - "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: + "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \ + "OMA" in self._parameters["StoreSupplementaryCalculations"] or \ + "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \ + "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"] or \ + "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \ + "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"] or \ + "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: HXa = Hm * Xa oma = Y - HXa if self._parameters["StoreInternalVariables"] or \ @@ -163,6 +164,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # # Calculs et/ou stockages supplémentaires # --------------------------------------- + if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["CurrentState"].store( numpy.ravel(Xa) ) if "Innovation" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["Innovation"].store( numpy.ravel(d) ) if "BMA" in self._parameters["StoreSupplementaryCalculations"]: @@ -179,7 +182,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["MahalanobisConsistency"].store( float( 2.*J/d.size ) ) if "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: - Qtls = self._parameters["Quantiles"] + Qtls = map(float, self._parameters["Quantiles"]) nech = self._parameters["NumberOfSamplesForQuantiles"] YfQ = None for i in range(nech): @@ -204,6 +207,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): self.StoredVariables["SimulationQuantiles"].store( YQ ) if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) ) + if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(HXa) ) if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) ) # diff --git a/src/daComposant/daAlgorithms/EnsembleBlue.py b/src/daComposant/daAlgorithms/EnsembleBlue.py index e1cfb5b..35f6101 100644 --- a/src/daComposant/daAlgorithms/EnsembleBlue.py +++ b/src/daComposant/daAlgorithms/EnsembleBlue.py @@ -28,6 +28,19 @@ import numpy class ElementaryAlgorithm(BasicObjects.Algorithm): def __init__(self): BasicObjects.Algorithm.__init__(self, "ENSEMBLEBLUE") + self.defineRequiredParameter( + name = "StoreInternalVariables", + default = False, + typecast = bool, + message = "Stockage des variables internes ou intermédiaires du calcul", + ) + self.defineRequiredParameter( + name = "StoreSupplementaryCalculations", + default = [], + typecast = tuple, + message = "Liste de calculs supplémentaires à stocker et/ou effectuer", + listval = ["CurrentState", "Innovation", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"] + ) self.defineRequiredParameter( name = "SetSeed", typecast = numpy.random.seed, @@ -77,16 +90,24 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Calcul du BLUE pour chaque membre de l'ensemble # ----------------------------------------------- for iens in range(nb_ens): - d = EnsembleY[:,iens] - Hm * Xb[iens] + HXb = Hm * Xb[iens] + if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) ) + d = EnsembleY[:,iens] - HXb + if "Innovation" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["Innovation"].store( numpy.ravel(d) ) Xa = Xb[iens] + K*d self.StoredVariables["CurrentState"].store( Xa ) - self.StoredVariables["Innovation"].store( d.A1 ) + if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["SimulatedObservationAtCurrentState"].store( Hm * Xa ) # # Fabrication de l'analyse # ------------------------ Members = self.StoredVariables["CurrentState"][-nb_ens:] Xa = numpy.matrix( Members ).mean(axis=0) self.StoredVariables["Analysis"].store( Xa.A1 ) + if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel( Hm * Xa ) ) # self._post_run(HO) return 0 diff --git a/src/daComposant/daAlgorithms/ExtendedBlue.py b/src/daComposant/daAlgorithms/ExtendedBlue.py index eb1fc59..c36ded9 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 = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtOptimum"] + listval = ["APosterioriCorrelations", "APosterioriCovariance", "APosterioriStandardDeviations", "APosterioriVariances", "BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "Innovation", "SigmaBck2", "SigmaObs2", "MahalanobisConsistency", "SimulationQuantiles", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"] ) self.defineRequiredParameter( name = "Quantiles", @@ -128,12 +128,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Calcul de la fonction coût # -------------------------- if self._parameters["StoreInternalVariables"] or \ - "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \ - "OMA" in self._parameters["StoreSupplementaryCalculations"] or \ - "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \ - "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"] or \ - "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"] or \ - "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: + "CostFunctionJ" in self._parameters["StoreSupplementaryCalculations"] or \ + "OMA" in self._parameters["StoreSupplementaryCalculations"] or \ + "SigmaObs2" in self._parameters["StoreSupplementaryCalculations"] or \ + "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"] or \ + "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"] or \ + "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"] or \ + "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: HXa = numpy.matrix(numpy.ravel( H( Xa ) )).T oma = Y - HXa if self._parameters["StoreInternalVariables"] or \ @@ -149,7 +150,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # Calcul de la covariance d'analyse # --------------------------------- if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"] or \ - "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: + "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: if (Y.size <= Xb.size) and (Y.size > 100): K = B * Ha * (R + Hm * B * Ha).I elif (Y.size > Xb.size) and (Y.size > 100): K = (BI + Ha * RI * Hm).I * Ha * RI else: pass # K deja calcule @@ -167,6 +168,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # # Calculs et/ou stockages supplémentaires # --------------------------------------- + if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["CurrentState"].store( numpy.ravel(Xa) ) if "Innovation" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["Innovation"].store( numpy.ravel(d) ) if "BMA" in self._parameters["StoreSupplementaryCalculations"]: @@ -183,7 +186,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if "MahalanobisConsistency" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["MahalanobisConsistency"].store( float( 2.*J/d.size ) ) if "SimulationQuantiles" in self._parameters["StoreSupplementaryCalculations"]: - Qtls = self._parameters["Quantiles"] + Qtls = map(float, self._parameters["Quantiles"]) nech = self._parameters["NumberOfSamplesForQuantiles"] HtM = HO["Tangent"].asMatrix(ValueForMethodForm = Xa) HtM = HtM.reshape(Y.size,Xa.size) # ADAO & check shape @@ -210,6 +213,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): self.StoredVariables["SimulationQuantiles"].store( YQ ) if "SimulatedObservationAtBackground" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["SimulatedObservationAtBackground"].store( numpy.ravel(HXb) ) + if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(HXa) ) if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) ) # diff --git a/src/daComposant/daAlgorithms/LinearLeastSquares.py b/src/daComposant/daAlgorithms/LinearLeastSquares.py index d6ddcfd..e85c8f2 100644 --- a/src/daComposant/daAlgorithms/LinearLeastSquares.py +++ b/src/daComposant/daAlgorithms/LinearLeastSquares.py @@ -39,7 +39,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["OMA", "CostFunctionJ", "SimulatedObservationAtOptimum"] + listval = ["OMA", "CurrentState", "CostFunctionJ", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"] ) def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None): @@ -83,8 +83,12 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # # Calculs et/ou stockages supplémentaires # --------------------------------------- + if self._parameters["StoreInternalVariables"] or "CurrentState" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["CurrentState"].store( numpy.ravel(Xa) ) if "OMA" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["OMA"].store( numpy.ravel(oma) ) + if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]: + self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(HXa) ) if "SimulatedObservationAtOptimum" in self._parameters["StoreSupplementaryCalculations"]: self.StoredVariables["SimulatedObservationAtOptimum"].store( numpy.ravel(HXa) ) # diff --git a/src/daComposant/daCore/BasicObjects.py b/src/daComposant/daCore/BasicObjects.py index 345f04b..fc6708b 100644 --- a/src/daComposant/daCore/BasicObjects.py +++ b/src/daComposant/daCore/BasicObjects.py @@ -417,9 +417,9 @@ class Algorithm: if typecast is None: __val = value else: __val = typecast( value ) # - if minval is not None and (numpy.array(__val) < minval).any(): + if minval is not None and (numpy.array(__val, float) < minval).any(): raise ValueError("The parameter named \"%s\" of value \"%s\" can not be less than %s."%(name, __val, minval)) - if maxval is not None and (numpy.array(__val) > maxval).any(): + if maxval is not None and (numpy.array(__val, float) > maxval).any(): raise ValueError("The parameter named \"%s\" of value \"%s\" can not be greater than %s."%(name, __val, maxval)) if listval is not None: if typecast is list or typecast is tuple or type(__val) is list or type(__val) is tuple: -- 2.39.2