From 989279bb7ab98626dbe3e7ef3c650ac40d8ee504 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Wed, 30 Mar 2022 20:28:20 +0200 Subject: [PATCH] Code improvements and update for iteration control Including documentation --- doc/en/advanced.rst | 11 ++++++++- doc/en/ref_algorithm_3DVAR.rst | 2 +- doc/en/ref_algorithm_4DVAR.rst | 2 +- ...f_algorithm_DerivativeFreeOptimization.rst | 2 +- .../ref_algorithm_DifferentialEvolution.rst | 2 +- .../ref_algorithm_NonLinearLeastSquares.rst | 2 +- ...ef_algorithm_ParticleSwarmOptimization.rst | 2 +- doc/en/ref_algorithm_QuantileRegression.rst | 2 +- doc/en/ref_algorithm_TabuSearch.rst | 2 +- doc/en/ref_options_AlgorithmParameters.rst | 4 ++-- doc/en/scripts/simple_3DVAR.py | 2 +- .../scripts/simple_NonLinearLeastSquares.py | 2 +- doc/en/scripts/tui_example_11.py | 2 +- doc/en/snippets/CurrentIterationNumber.rst | 3 ++- doc/en/snippets/CurrentStepNumber.rst | 5 ++-- ...teps.rst => MaximumNumberOfIterations.rst} | 6 ++--- ...0.rst => MaximumNumberOfIterations_50.rst} | 6 ++--- doc/en/tutorials_in_salome.rst | 14 +++++------ doc/fr/advanced.rst | 23 ++++++++++++++----- doc/fr/ref_algorithm_3DVAR.rst | 2 +- doc/fr/ref_algorithm_4DVAR.rst | 2 +- ...f_algorithm_DerivativeFreeOptimization.rst | 2 +- .../ref_algorithm_DifferentialEvolution.rst | 2 +- .../ref_algorithm_NonLinearLeastSquares.rst | 2 +- ...ef_algorithm_ParticleSwarmOptimization.rst | 2 +- doc/fr/ref_algorithm_QuantileRegression.rst | 2 +- doc/fr/ref_algorithm_TabuSearch.rst | 2 +- doc/fr/ref_options_AlgorithmParameters.rst | 4 ++-- doc/fr/scripts/simple_3DVAR.py | 2 +- .../scripts/simple_NonLinearLeastSquares.py | 2 +- doc/fr/scripts/tui_example_11.py | 2 +- doc/fr/snippets/CurrentIterationNumber.rst | 3 ++- doc/fr/snippets/CurrentStepNumber.rst | 5 ++-- ...teps.rst => MaximumNumberOfIterations.rst} | 6 ++--- ...0.rst => MaximumNumberOfIterations_50.rst} | 6 ++--- doc/fr/tutorials_in_salome.rst | 14 +++++------ examples/daSalome/test006_Observers_init.py | 2 +- .../Script_AlgorithmParameters.py | 10 ++++---- src/daComposant/daAlgorithms/3DVAR.py | 2 +- src/daComposant/daAlgorithms/4DVAR.py | 2 +- src/daComposant/daAlgorithms/Atoms/ecwnlls.py | 12 +++++----- .../daAlgorithms/Atoms/incr3dvar.py | 12 +++++----- .../daAlgorithms/Atoms/psas3dvar.py | 10 ++++---- .../daAlgorithms/Atoms/std3dvar.py | 10 ++++---- .../daAlgorithms/Atoms/std4dvar.py | 10 ++++---- .../daAlgorithms/Atoms/van3dvar.py | 10 ++++---- .../DerivativeFreeOptimization.py | 6 ++--- .../daAlgorithms/DifferentialEvolution.py | 4 ++-- .../daAlgorithms/NonLinearLeastSquares.py | 2 +- .../daAlgorithms/ParticleSwarmOptimization.py | 4 ++-- .../daAlgorithms/QuantileRegression.py | 4 ++-- src/daComposant/daAlgorithms/TabuSearch.py | 4 ++-- src/daComposant/daCore/BasicObjects.py | 2 +- src/daComposant/daCore/Interfaces.py | 20 +++++++++++++++- src/daComposant/daCore/NumericObjects.py | 2 +- src/daEficas/traduitADAOV7_4_0ToV9_9_0.py | 7 +++--- src/daEficas/traduitADAOV7_5_0ToV9_9_0.py | 7 +++--- src/daEficas/traduitADAOV7_5_1ToV9_9_0.py | 7 +++--- src/daEficas/traduitADAOV7_6_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV7_7_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV7_8_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV8_1_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV8_2_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV8_3_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV8_4_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV8_5_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV8_6_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV9_2_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV9_3_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV9_4_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV9_5_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV9_6_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV9_7_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOV9_8_0ToV9_9_0.py | 5 ++-- src/daEficas/traduitADAOsansToV9_9_0.py | 9 ++++---- test/test6703/Doc_TUI_Exemple_03.py | 2 +- .../Doc_TUI_Exemple_03_en_multifonction.py | 2 +- test/test6711/Doc_TUI_Exemple_02_Arguments.py | 4 ++-- .../Definition_complete_de_cas_3DVAR.py | 2 +- .../Definition_complete_de_cas_NLLS.py | 2 +- test/test6905/test914_Xternal_3_Variables.py | 2 +- 81 files changed, 234 insertions(+), 172 deletions(-) rename doc/en/snippets/{MaximumNumberOfSteps.rst => MaximumNumberOfIterations.rst} (83%) rename doc/en/snippets/{MaximumNumberOfSteps_50.rst => MaximumNumberOfIterations_50.rst} (69%) rename doc/fr/snippets/{MaximumNumberOfSteps.rst => MaximumNumberOfIterations.rst} (85%) rename doc/fr/snippets/{MaximumNumberOfSteps_50.rst => MaximumNumberOfIterations_50.rst} (70%) diff --git a/doc/en/advanced.rst b/doc/en/advanced.rst index d040a0d..2877cdd 100644 --- a/doc/en/advanced.rst +++ b/doc/en/advanced.rst @@ -524,7 +524,7 @@ the documentation of the different :ref:`section_reference_assimilation`. **A first way is to limit the default number of iterations in the iterative search processes**. Even if this is not the best theoretical way to control the algorithm, it is very effective in a real study process. For this purpose, the -keyword "*MaximumNumberOfSteps*" exists in all cases of calculations that +keyword "*MaximumNumberOfIterations*" exists in all cases of calculations that support it, and its default value is usually set to an equivalent of infinity so that it is not the stopping criterion. This is the case for calculations based on variational methods such as :ref:`section_ref_algorithm_3DVAR`, @@ -593,6 +593,15 @@ There is no known incompatibility for the ADAO case files. The upgrade procedure is to read the old ADAO case file with the new SALOME/ADAO module, and save it with a new name. +However, there may be incompatibilities from user cases written directly in TUI +interface. It is advisable to review the syntax and arguments in the TUI +scripts at each version change. In particular, it is advisable to check that +the algorithm parameters are still adequate and active, knowing that it has +been explicitly chosen that there is no message when a parameter becomes +inactive (for the example, we quote the parameter "*MaximumNumberOfSteps*" as +having changed its name to "*MaximumNumberOfIterations*", for homogeneity with +the variables that can be displayed). + Switching from 8.5 to 9.2 +++++++++++++++++++++++++ diff --git a/doc/en/ref_algorithm_3DVAR.rst b/doc/en/ref_algorithm_3DVAR.rst index ce22a67..0d3b290 100644 --- a/doc/en/ref_algorithm_3DVAR.rst +++ b/doc/en/ref_algorithm_3DVAR.rst @@ -93,7 +93,7 @@ unlike Kalman-type filters, the state error covariance is not updated. .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Minimizer_xDVAR.rst diff --git a/doc/en/ref_algorithm_4DVAR.rst b/doc/en/ref_algorithm_4DVAR.rst index a845016..9bba847 100644 --- a/doc/en/ref_algorithm_4DVAR.rst +++ b/doc/en/ref_algorithm_4DVAR.rst @@ -79,7 +79,7 @@ its application domain is similar to the one of Kalman filters, specially the .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Minimizer_xDVAR.rst diff --git a/doc/en/ref_algorithm_DerivativeFreeOptimization.rst b/doc/en/ref_algorithm_DerivativeFreeOptimization.rst index 354743c..504447f 100644 --- a/doc/en/ref_algorithm_DerivativeFreeOptimization.rst +++ b/doc/en/ref_algorithm_DerivativeFreeOptimization.rst @@ -62,7 +62,7 @@ least squares function, classically used in data assimilation. .. include:: snippets/BoundsWithNone.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/MaximumNumberOfFunctionEvaluations.rst diff --git a/doc/en/ref_algorithm_DifferentialEvolution.rst b/doc/en/ref_algorithm_DifferentialEvolution.rst index 0cb8119..06acf3f 100644 --- a/doc/en/ref_algorithm_DifferentialEvolution.rst +++ b/doc/en/ref_algorithm_DifferentialEvolution.rst @@ -68,7 +68,7 @@ least squares function, classically used in data assimilation. .. include:: snippets/CrossOverProbability_CR.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/MaximumNumberOfFunctionEvaluations.rst diff --git a/doc/en/ref_algorithm_NonLinearLeastSquares.rst b/doc/en/ref_algorithm_NonLinearLeastSquares.rst index 8284ba5..2f716ef 100644 --- a/doc/en/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/en/ref_algorithm_NonLinearLeastSquares.rst @@ -73,7 +73,7 @@ for its stability as for its behavior during optimization. .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Minimizer_xDVAR.rst diff --git a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst index 8098deb..2af5fcb 100644 --- a/doc/en/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/en/ref_algorithm_ParticleSwarmOptimization.rst @@ -59,7 +59,7 @@ least squares function, classically used in data assimilation. .. ------------------------------------ .. .. include:: snippets/Header2Algo03AdOp.rst -.. include:: snippets/MaximumNumberOfSteps_50.rst +.. include:: snippets/MaximumNumberOfIterations_50.rst .. include:: snippets/MaximumNumberOfFunctionEvaluations.rst diff --git a/doc/en/ref_algorithm_QuantileRegression.rst b/doc/en/ref_algorithm_QuantileRegression.rst index 1173475..c2645fc 100644 --- a/doc/en/ref_algorithm_QuantileRegression.rst +++ b/doc/en/ref_algorithm_QuantileRegression.rst @@ -53,7 +53,7 @@ the model parameters that satisfy to the quantiles conditions. .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Quantile.rst diff --git a/doc/en/ref_algorithm_TabuSearch.rst b/doc/en/ref_algorithm_TabuSearch.rst index 7340de7..ae2ad5f 100644 --- a/doc/en/ref_algorithm_TabuSearch.rst +++ b/doc/en/ref_algorithm_TabuSearch.rst @@ -68,7 +68,7 @@ Positions already explored are kept in a list of finite length. .. include:: snippets/LengthOfTabuList.rst -.. include:: snippets/MaximumNumberOfSteps_50.rst +.. include:: snippets/MaximumNumberOfIterations_50.rst .. include:: snippets/NoiseAddingProbability.rst diff --git a/doc/en/ref_options_AlgorithmParameters.rst b/doc/en/ref_options_AlgorithmParameters.rst index 84ce1f7..34f88c6 100644 --- a/doc/en/ref_options_AlgorithmParameters.rst +++ b/doc/en/ref_options_AlgorithmParameters.rst @@ -100,7 +100,7 @@ shown in the following figure: In the entry, one must enclose a standard dictionary definition between simple quotes, as for example:: - '{"MaximumNumberOfSteps":25,"SetSeed":1000}' + '{"MaximumNumberOfIterations":25,"SetSeed":1000}' It is the recommended way to define algorithmic parameters. This method allows in particular to keep options or parameters for other algorithms than the @@ -129,7 +129,7 @@ This external Python script file has then to define a variable with the required name "*AlgorithmParameters*", as in the following example:: AlgorithmParameters = { - "MaximumNumberOfSteps" : 25, + "MaximumNumberOfIterations" : 25, "StoreSupplementaryCalculations" : ["APosterioriCovariance","OMA"], } diff --git a/doc/en/scripts/simple_3DVAR.py b/doc/en/scripts/simple_3DVAR.py index 59e41f6..b546284 100644 --- a/doc/en/scripts/simple_3DVAR.py +++ b/doc/en/scripts/simple_3DVAR.py @@ -28,7 +28,7 @@ case.setObservationOperator( OneFunction = QuadFunction ) case.setAlgorithmParameters( Algorithm='3DVAR', Parameters={ - 'MaximumNumberOfSteps': 100, + 'MaximumNumberOfIterations': 100, 'StoreSupplementaryCalculations': [ 'CurrentState', ], diff --git a/doc/en/scripts/simple_NonLinearLeastSquares.py b/doc/en/scripts/simple_NonLinearLeastSquares.py index 6ac8873..08b5aea 100644 --- a/doc/en/scripts/simple_NonLinearLeastSquares.py +++ b/doc/en/scripts/simple_NonLinearLeastSquares.py @@ -27,7 +27,7 @@ case.setObservationOperator( OneFunction = QuadFunction ) case.setAlgorithmParameters( Algorithm='NonLinearLeastSquares', Parameters={ - 'MaximumNumberOfSteps': 100, + 'MaximumNumberOfIterations': 100, 'StoreSupplementaryCalculations': [ 'CurrentState', ], diff --git a/doc/en/scripts/tui_example_11.py b/doc/en/scripts/tui_example_11.py index c0cbc76..676a99f 100644 --- a/doc/en/scripts/tui_example_11.py +++ b/doc/en/scripts/tui_example_11.py @@ -46,7 +46,7 @@ case.set( Algorithm = '3DVAR', Parameters = { "Bounds":Bounds, - "MaximumNumberOfSteps":100, + "MaximumNumberOfIterations":100, "StoreSupplementaryCalculations":[ "CostFunctionJ", "CurrentState", diff --git a/doc/en/snippets/CurrentIterationNumber.rst b/doc/en/snippets/CurrentIterationNumber.rst index 8409421..2c8ed6c 100644 --- a/doc/en/snippets/CurrentIterationNumber.rst +++ b/doc/en/snippets/CurrentIterationNumber.rst @@ -2,7 +2,8 @@ CurrentIterationNumber *List of integers*. Each element is the iteration index at the current step - during the iterative algorithm procedure. + during the iterative algorithm procedure. There is one iteration index value + per assimilation step corresponding to an observed state. Example: ``i = ADD.get("CurrentIterationNumber")[-1]`` diff --git a/doc/en/snippets/CurrentStepNumber.rst b/doc/en/snippets/CurrentStepNumber.rst index 9896f05..2a42555 100644 --- a/doc/en/snippets/CurrentStepNumber.rst +++ b/doc/en/snippets/CurrentStepNumber.rst @@ -3,8 +3,9 @@ CurrentStepNumber *List of integers*. Each element is the index of the current step in the iterative process, driven by the series of observations, of the algorithm - used. Note: it is not the index of the current iteration of the algorithm - even if it coincides for non-iterative algorithms. + used. This corresponds to the observation step used. Note: it is not the + index of the current iteration of the algorithm even if it coincides for + non-iterative algorithms. Example: ``i = ADD.get("CurrentStepNumber")[-1]`` diff --git a/doc/en/snippets/MaximumNumberOfSteps.rst b/doc/en/snippets/MaximumNumberOfIterations.rst similarity index 83% rename from doc/en/snippets/MaximumNumberOfSteps.rst rename to doc/en/snippets/MaximumNumberOfIterations.rst index cf4634f..5325099 100644 --- a/doc/en/snippets/MaximumNumberOfSteps.rst +++ b/doc/en/snippets/MaximumNumberOfIterations.rst @@ -1,6 +1,6 @@ -.. index:: single: MaximumNumberOfSteps +.. index:: single: MaximumNumberOfIterations -MaximumNumberOfSteps +MaximumNumberOfIterations *Integer value*. This key indicates the maximum number of iterations allowed for iterative optimization. The default is 15000, which is very similar to no limit on iterations. It is then recommended to adapt this parameter to the @@ -11,4 +11,4 @@ MaximumNumberOfSteps recommendations. Example: - ``{"MaximumNumberOfSteps":100}`` + ``{"MaximumNumberOfIterations":100}`` diff --git a/doc/en/snippets/MaximumNumberOfSteps_50.rst b/doc/en/snippets/MaximumNumberOfIterations_50.rst similarity index 69% rename from doc/en/snippets/MaximumNumberOfSteps_50.rst rename to doc/en/snippets/MaximumNumberOfIterations_50.rst index 4a56754..45e4659 100644 --- a/doc/en/snippets/MaximumNumberOfSteps_50.rst +++ b/doc/en/snippets/MaximumNumberOfIterations_50.rst @@ -1,9 +1,9 @@ -.. index:: single: MaximumNumberOfSteps +.. index:: single: MaximumNumberOfIterations -MaximumNumberOfSteps +MaximumNumberOfIterations *Integer value*. This key indicates the maximum number of iterations allowed for iterative optimization. The default is 50, which is an arbitrary limit. It is then recommended to adapt this parameter to the needs on real problems. Example: - ``{"MaximumNumberOfSteps":50}`` + ``{"MaximumNumberOfIterations":50}`` diff --git a/doc/en/tutorials_in_salome.rst b/doc/en/tutorials_in_salome.rst index 7dccc2b..440dbfa 100644 --- a/doc/en/tutorials_in_salome.rst +++ b/doc/en/tutorials_in_salome.rst @@ -335,7 +335,7 @@ dictionary, containing some key/value pairs. The list of possible optional parameters are given in the section :ref:`section_reference` and its subsections. The recommendation is to use the explicit definition of values from the default list of optional parameters, as here with the -"*MaximumNumberOfSteps*": +"*MaximumNumberOfIterations*": .. _adao_scriptentry02: .. image:: images/adao_scriptentry02.png @@ -352,7 +352,7 @@ default values, and can exist without being used. For example: AlgorithmParameters = { "Minimizer" : "LBFGSB", # Recommended - "MaximumNumberOfSteps" : 10, + "MaximumNumberOfIterations" : 10, } If no bounds at all are required on the control variables, then one can choose @@ -576,12 +576,12 @@ the following parameters can be defined in a Python script file named # Creating the required ADAO variable # ----------------------------------- AlgorithmParameters = { - "Minimizer" : "LBFGSB", # Recommended - "MaximumNumberOfSteps" : 15, # Number of global iterative steps + "Minimizer" : "LBFGSB", # Recommended + "MaximumNumberOfIterations" : 15, # Number of global iterative steps "Bounds" : [ - [ None, None ], # Bound on the first parameter - [ 0., 4. ], # Bound on the second parameter - [ 0., None ], # Bound on the third parameter + [ None, None ], # Bound on the first parameter + [ 0., 4. ], # Bound on the second parameter + [ 0., None ], # Bound on the third parameter ], "StoreSupplementaryCalculations" : [ "CurrentState", diff --git a/doc/fr/advanced.rst b/doc/fr/advanced.rst index 12519aa..94b362b 100644 --- a/doc/fr/advanced.rst +++ b/doc/fr/advanced.rst @@ -570,11 +570,12 @@ documentation des différents :ref:`section_reference_assimilation`. **Un premier moyen est de limiter le nombre d'itérations par défaut dans les processus de recherches itératives**. Même si ce n'est pas la meilleure manière théorique de contrôler l'algorithme, elle est très efficace dans un processus -d'étude réelle. Pour cela, le mot-clé "*MaximumNumberOfSteps*" existe dans tous -les cas de calculs qui le supportent, et sa valeur par défaut est usuellement -fixée à un équivalent de l'infini pour que ce ne soit pas le critère d'arrêt. -C'est le cas pour les calculs à base de méthodes variationnelles comme les -:ref:`section_ref_algorithm_3DVAR`, :ref:`section_ref_algorithm_4DVAR` et +d'étude réelle. Pour cela, le mot-clé "*MaximumNumberOfIterations*" existe dans +tous les cas de calculs qui le supportent, et sa valeur par défaut est +usuellement fixée à un équivalent de l'infini pour que ce ne soit pas le +critère d'arrêt. C'est le cas pour les calculs à base de méthodes +variationnelles comme les :ref:`section_ref_algorithm_3DVAR`, +:ref:`section_ref_algorithm_4DVAR` et :ref:`section_ref_algorithm_NonLinearLeastSquares`, mais c'est aussi le cas pour d'autres comme les :ref:`section_ref_algorithm_DerivativeFreeOptimization` ou :ref:`section_ref_algorithm_QuantileRegression`. Dans la pratique, on @@ -646,6 +647,16 @@ Il n'y a pas d'incompatibilité connue pour les fichiers de cas ADAO. La procédure de montée en version consiste à lire l'ancien fichier de cas ADAO avec le nouveau module SALOME/ADAO, et à l'enregistrer avec un nouveau nom. +Cependant, il peut se présenter des incompatibilités provenant de cas +utilisateurs écrits directement en interface TUI. Il est conseillé de revoir la +syntaxe et les arguments dans les scripts TUI à chaque changement de version. +En particulier, il convient de vérifier que les paramètres d'algorithme sont +toujours adéquats et actifs, sachant qu'il a été explicitement choisi qu'il n'y +ait pas de message lorsqu'un paramètre devient inactif (pour l'exemple, on cite +le paramètre "*MaximumNumberOfSteps*" comme ayant changé de nom pour devenir +"*MaximumNumberOfIterations*", par homogénéité avec les variables pouvant être +affichées). + Passer de la version 8.5 à la 9.2 +++++++++++++++++++++++++++++++++ @@ -653,7 +664,7 @@ Il n'y a pas d'incompatibilité connue pour les fichiers de cas ADAO. La procédure de montée en version consiste à lire l'ancien fichier de cas ADAO avec le nouveau module SALOME/ADAO, et à l'enregistrer avec un nouveau nom. -Par contre, il peut se présenter des incompatibilités provenant de fichiers +Cependant, il peut se présenter des incompatibilités provenant de fichiers scripts utilisateurs qui n'auraient pas une syntaxe compatible avec Python 3. L'erreur la plus immédiate est l'usage de l'impression "*print*" avec la syntaxe "*commande*" au lieu de la syntaxe fonctionnelle "*print(...)*". Dans diff --git a/doc/fr/ref_algorithm_3DVAR.rst b/doc/fr/ref_algorithm_3DVAR.rst index 36f910e..ed68757 100644 --- a/doc/fr/ref_algorithm_3DVAR.rst +++ b/doc/fr/ref_algorithm_3DVAR.rst @@ -98,7 +98,7 @@ n'est pas remise à jour. .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Minimizer_xDVAR.rst diff --git a/doc/fr/ref_algorithm_4DVAR.rst b/doc/fr/ref_algorithm_4DVAR.rst index 1e2a0a9..448b31d 100644 --- a/doc/fr/ref_algorithm_4DVAR.rst +++ b/doc/fr/ref_algorithm_4DVAR.rst @@ -80,7 +80,7 @@ l':ref:`section_ref_algorithm_UnscentedKalmanFilter`. .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Minimizer_xDVAR.rst diff --git a/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst b/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst index 2b6ef28..a24c68a 100644 --- a/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst +++ b/doc/fr/ref_algorithm_DerivativeFreeOptimization.rst @@ -64,7 +64,7 @@ en assimilation de données. .. include:: snippets/BoundsWithNone.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/MaximumNumberOfFunctionEvaluations.rst diff --git a/doc/fr/ref_algorithm_DifferentialEvolution.rst b/doc/fr/ref_algorithm_DifferentialEvolution.rst index 2377f00..9f8008b 100644 --- a/doc/fr/ref_algorithm_DifferentialEvolution.rst +++ b/doc/fr/ref_algorithm_DifferentialEvolution.rst @@ -69,7 +69,7 @@ en assimilation de données. .. include:: snippets/CrossOverProbability_CR.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/MaximumNumberOfFunctionEvaluations.rst diff --git a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst index 07edd73..0395239 100644 --- a/doc/fr/ref_algorithm_NonLinearLeastSquares.rst +++ b/doc/fr/ref_algorithm_NonLinearLeastSquares.rst @@ -75,7 +75,7 @@ comportement lors de l'optimisation. .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Minimizer_xDVAR.rst diff --git a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst index 006265d..2dea1b7 100644 --- a/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst +++ b/doc/fr/ref_algorithm_ParticleSwarmOptimization.rst @@ -60,7 +60,7 @@ en assimilation de données. .. ------------------------------------ .. .. include:: snippets/Header2Algo03AdOp.rst -.. include:: snippets/MaximumNumberOfSteps_50.rst +.. include:: snippets/MaximumNumberOfIterations_50.rst .. include:: snippets/MaximumNumberOfFunctionEvaluations.rst diff --git a/doc/fr/ref_algorithm_QuantileRegression.rst b/doc/fr/ref_algorithm_QuantileRegression.rst index 7a182dc..6a9169e 100644 --- a/doc/fr/ref_algorithm_QuantileRegression.rst +++ b/doc/fr/ref_algorithm_QuantileRegression.rst @@ -53,7 +53,7 @@ déterminer les paramètres de modèles satisfaisant aux conditions de quantiles .. include:: snippets/InitializationPoint.rst -.. include:: snippets/MaximumNumberOfSteps.rst +.. include:: snippets/MaximumNumberOfIterations.rst .. include:: snippets/Quantile.rst diff --git a/doc/fr/ref_algorithm_TabuSearch.rst b/doc/fr/ref_algorithm_TabuSearch.rst index 4b19204..ea05e78 100644 --- a/doc/fr/ref_algorithm_TabuSearch.rst +++ b/doc/fr/ref_algorithm_TabuSearch.rst @@ -70,7 +70,7 @@ liste de longueur finie. .. include:: snippets/LengthOfTabuList.rst -.. include:: snippets/MaximumNumberOfSteps_50.rst +.. include:: snippets/MaximumNumberOfIterations_50.rst .. include:: snippets/NoiseAddingProbability.rst diff --git a/doc/fr/ref_options_AlgorithmParameters.rst b/doc/fr/ref_options_AlgorithmParameters.rst index 50b6de1..f390092 100644 --- a/doc/fr/ref_options_AlgorithmParameters.rst +++ b/doc/fr/ref_options_AlgorithmParameters.rst @@ -104,7 +104,7 @@ commande "*Dict*" qui apparaît, comme montré dans la figure qui suit : Dans le champs de saisie, il faut utiliser des guillemets simples pour une définition standard de dictionnaire, comme par exemple:: - '{"MaximumNumberOfSteps":25,"SetSeed":1000}' + '{"MaximumNumberOfIterations":25,"SetSeed":1000}' C'est la manière recommandée pour définir des paramètres algorithmiques. Cette méthode permet en particulier de conserver des options ou des paramètres pour @@ -134,7 +134,7 @@ Ce fichier script Python externe doit définir alors une variable au nom imposé "*AlgorithmParameters*", à la manière de l'exemple qui suit:: AlgorithmParameters = { - "MaximumNumberOfSteps" : 25, + "MaximumNumberOfIterations" : 25, "StoreSupplementaryCalculations" : ["APosterioriCovariance","OMA"], } diff --git a/doc/fr/scripts/simple_3DVAR.py b/doc/fr/scripts/simple_3DVAR.py index 3e98561..d86adbb 100644 --- a/doc/fr/scripts/simple_3DVAR.py +++ b/doc/fr/scripts/simple_3DVAR.py @@ -28,7 +28,7 @@ case.setObservationOperator( OneFunction = QuadFunction ) case.setAlgorithmParameters( Algorithm='3DVAR', Parameters={ - 'MaximumNumberOfSteps': 100, + 'MaximumNumberOfIterations': 100, 'StoreSupplementaryCalculations': [ 'CurrentState', ], diff --git a/doc/fr/scripts/simple_NonLinearLeastSquares.py b/doc/fr/scripts/simple_NonLinearLeastSquares.py index 8de1623..629527c 100644 --- a/doc/fr/scripts/simple_NonLinearLeastSquares.py +++ b/doc/fr/scripts/simple_NonLinearLeastSquares.py @@ -27,7 +27,7 @@ case.setObservationOperator( OneFunction = QuadFunction ) case.setAlgorithmParameters( Algorithm='NonLinearLeastSquares', Parameters={ - 'MaximumNumberOfSteps': 100, + 'MaximumNumberOfIterations': 100, 'StoreSupplementaryCalculations': [ 'CurrentState', ], diff --git a/doc/fr/scripts/tui_example_11.py b/doc/fr/scripts/tui_example_11.py index e0f8839..452efd4 100644 --- a/doc/fr/scripts/tui_example_11.py +++ b/doc/fr/scripts/tui_example_11.py @@ -46,7 +46,7 @@ case.set( Algorithm = '3DVAR', Parameters = { "Bounds":Bounds, - "MaximumNumberOfSteps":100, + "MaximumNumberOfIterations":100, "StoreSupplementaryCalculations":[ "CostFunctionJ", "CurrentState", diff --git a/doc/fr/snippets/CurrentIterationNumber.rst b/doc/fr/snippets/CurrentIterationNumber.rst index 63d285d..81548f4 100644 --- a/doc/fr/snippets/CurrentIterationNumber.rst +++ b/doc/fr/snippets/CurrentIterationNumber.rst @@ -2,7 +2,8 @@ CurrentIterationNumber *Liste d'entiers*. Chaque élément est l'index d'itération courant au cours du - déroulement itératif de l'algorithme utilisé. + déroulement itératif de l'algorithme utilisé. Il y a une valeur d'index + d'itération par pas d'assimilation correspondant à un état observé. Exemple : ``i = ADD.get("CurrentIterationNumber")[-1]`` diff --git a/doc/fr/snippets/CurrentStepNumber.rst b/doc/fr/snippets/CurrentStepNumber.rst index 033ad41..69fdc06 100644 --- a/doc/fr/snippets/CurrentStepNumber.rst +++ b/doc/fr/snippets/CurrentStepNumber.rst @@ -3,8 +3,9 @@ CurrentStepNumber *Liste d'entiers*. Chaque élément est l'index du pas courant au cours du déroulement itératif, piloté par la série des observations, de l'algorithme - utilisé. Remarque : ce n'est pas l'index d'itération courant d'algorithme - même si cela coïncide pour des algorithmes non itératifs. + utilisé. Cela correspond au pas d'observation utilisé. Remarque : ce n'est + pas l'index d'itération courant d'algorithme même si cela coïncide pour des + algorithmes non itératifs. Exemple : ``i = ADD.get("CurrentStepNumber")[-1]`` diff --git a/doc/fr/snippets/MaximumNumberOfSteps.rst b/doc/fr/snippets/MaximumNumberOfIterations.rst similarity index 85% rename from doc/fr/snippets/MaximumNumberOfSteps.rst rename to doc/fr/snippets/MaximumNumberOfIterations.rst index d56cce3..3ede565 100644 --- a/doc/fr/snippets/MaximumNumberOfSteps.rst +++ b/doc/fr/snippets/MaximumNumberOfIterations.rst @@ -1,6 +1,6 @@ -.. index:: single: MaximumNumberOfSteps +.. index:: single: MaximumNumberOfIterations -MaximumNumberOfSteps +MaximumNumberOfIterations *Valeur entière*. Cette clé indique le nombre maximum d'itérations possibles en optimisation itérative. Le défaut est 15000, qui est très similaire à une absence de limite sur les itérations. Il est ainsi recommandé d'adapter ce @@ -12,4 +12,4 @@ MaximumNumberOfSteps détaillées. Exemple : - ``{"MaximumNumberOfSteps":100}`` + ``{"MaximumNumberOfIterations":100}`` diff --git a/doc/fr/snippets/MaximumNumberOfSteps_50.rst b/doc/fr/snippets/MaximumNumberOfIterations_50.rst similarity index 70% rename from doc/fr/snippets/MaximumNumberOfSteps_50.rst rename to doc/fr/snippets/MaximumNumberOfIterations_50.rst index b8c9321..86b7e87 100644 --- a/doc/fr/snippets/MaximumNumberOfSteps_50.rst +++ b/doc/fr/snippets/MaximumNumberOfIterations_50.rst @@ -1,10 +1,10 @@ -.. index:: single: MaximumNumberOfSteps +.. index:: single: MaximumNumberOfIterations -MaximumNumberOfSteps +MaximumNumberOfIterations *Valeur entière*. Cette clé indique le nombre maximum d'itérations possibles en optimisation itérative. Le défaut est 50, qui est une limite arbitraire. Il est ainsi recommandé d'adapter ce paramètre aux besoins pour des problèmes réels. Exemple : - ``{"MaximumNumberOfSteps":50}`` + ``{"MaximumNumberOfIterations":50}`` diff --git a/doc/fr/tutorials_in_salome.rst b/doc/fr/tutorials_in_salome.rst index 8e1bb0a..08f50a4 100644 --- a/doc/fr/tutorials_in_salome.rst +++ b/doc/fr/tutorials_in_salome.rst @@ -352,7 +352,7 @@ défaut, ou à partir d'un dictionnaire Python, contenant des paires clé/valeur La liste des paramètres optionnels possibles est donnée dans la section :ref:`section_reference` et ses sous-sections. On recommande d'utiliser la définition explicite de valeurs à partir de la liste par défaut de paramètres -optionnels, comme ici avec le "*MaximumNumberOfSteps*" : +optionnels, comme ici avec le "*MaximumNumberOfIterations*" : .. _adao_scriptentry02: .. image:: images/adao_scriptentry02.png @@ -370,7 +370,7 @@ et elles peuvent être présentes sans être utiles. Par exemple : AlgorithmParameters = { "Minimizer" : "LBFGSB", # Recommended - "MaximumNumberOfSteps" : 10, + "MaximumNumberOfIterations" : 10, } Si aucune borne n'est requise sur les variables de contrôle, alors on peut @@ -607,12 +607,12 @@ définis dans un fichier de script Python nommé # Creating the required ADAO variable # ----------------------------------- AlgorithmParameters = { - "Minimizer" : "LBFGSB", # Recommended - "MaximumNumberOfSteps" : 15, # Number of global iterative steps + "Minimizer" : "LBFGSB", # Recommended + "MaximumNumberOfIterations" : 15, # Number of global iterative steps "Bounds" : [ - [ None, None ], # Bound on the first parameter - [ 0., 4. ], # Bound on the second parameter - [ 0., None ], # Bound on the third parameter + [ None, None ], # Bound on the first parameter + [ 0., 4. ], # Bound on the second parameter + [ 0., None ], # Bound on the third parameter ], "StoreSupplementaryCalculations" : [ "CurrentState", diff --git a/examples/daSalome/test006_Observers_init.py b/examples/daSalome/test006_Observers_init.py index e11bcd4..d0f72dd 100644 --- a/examples/daSalome/test006_Observers_init.py +++ b/examples/daSalome/test006_Observers_init.py @@ -70,4 +70,4 @@ init_data["BackgroundError"] = BackgroundError init_data["ObservationError"] = ObservationError # Algorithm Parameters -init_data["AlgorithmParameters"] = {"Minimizer":"LBFGSB","MaximumNumberOfSteps":5} +init_data["AlgorithmParameters"] = {"Minimizer":"LBFGSB","MaximumNumberOfIterations":5} diff --git a/examples/daSkeletons/External_data_definition_by_scripts/Script_AlgorithmParameters.py b/examples/daSkeletons/External_data_definition_by_scripts/Script_AlgorithmParameters.py index 9b21291..842f08f 100644 --- a/examples/daSkeletons/External_data_definition_by_scripts/Script_AlgorithmParameters.py +++ b/examples/daSkeletons/External_data_definition_by_scripts/Script_AlgorithmParameters.py @@ -33,12 +33,12 @@ __author__ = "Jean-Philippe ARGAUD" # Creating the required ADAO variable # ----------------------------------- AlgorithmParameters = { - "Minimizer" : "TNC", # Possible : "LBFGSB", "TNC", "CG", "BFGS" - "MaximumNumberOfSteps" : 15, # Number of iterative steps + "Minimizer" : "LBFGSB", # Possible : "LBFGSB", "TNC", "CG", "BFGS" + "MaximumNumberOfIterations" : 15, # Number of iterative steps "Bounds" : [ - [ None, None ], # Bound on the first parameter - [ 0., 4. ], # Bound on the second parameter - [ 0., None ], # Bound on the third parameter + [ None, None ], # Bound on the first parameter + [ 0., 4. ], # Bound on the second parameter + [ 0., None ], # Bound on the third parameter ], "StoreInternalVariables":True, } diff --git a/src/daComposant/daAlgorithms/3DVAR.py b/src/daComposant/daAlgorithms/3DVAR.py index f8318ca..996c7ec 100644 --- a/src/daComposant/daAlgorithms/3DVAR.py +++ b/src/daComposant/daAlgorithms/3DVAR.py @@ -66,7 +66,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): listval = ["State", "Parameters"], ) self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 15000, typecast = int, message = "Nombre maximal de pas d'optimisation", diff --git a/src/daComposant/daAlgorithms/4DVAR.py b/src/daComposant/daAlgorithms/4DVAR.py index 7f552b5..0a45328 100644 --- a/src/daComposant/daAlgorithms/4DVAR.py +++ b/src/daComposant/daAlgorithms/4DVAR.py @@ -62,7 +62,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): listval = ["LBFGSB","TNC", "CG", "NCG", "BFGS"], ) self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 15000, typecast = int, message = "Nombre maximal de pas d'optimisation", diff --git a/src/daComposant/daAlgorithms/Atoms/ecwnlls.py b/src/daComposant/daAlgorithms/Atoms/ecwnlls.py index 1d9ca01..2282695 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecwnlls.py +++ b/src/daComposant/daAlgorithms/Atoms/ecwnlls.py @@ -142,7 +142,7 @@ def ecwnlls(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = selfA._parameters["Bounds"], - maxfun = selfA._parameters["MaximumNumberOfSteps"]-1, + maxfun = selfA._parameters["MaximumNumberOfIterations"]-1, factr = selfA._parameters["CostDecrementTolerance"]*1.e14, pgtol = selfA._parameters["ProjectedGradientTolerance"], iprint = selfA._parameters["optiprint"], @@ -156,7 +156,7 @@ def ecwnlls(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = selfA._parameters["Bounds"], - maxfun = selfA._parameters["MaximumNumberOfSteps"], + maxfun = selfA._parameters["MaximumNumberOfIterations"], pgtol = selfA._parameters["ProjectedGradientTolerance"], ftol = selfA._parameters["CostDecrementTolerance"], messages = selfA._parameters["optmessages"], @@ -167,7 +167,7 @@ def ecwnlls(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -178,7 +178,7 @@ def ecwnlls(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], avextol = selfA._parameters["CostDecrementTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -189,7 +189,7 @@ def ecwnlls(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -201,7 +201,7 @@ def ecwnlls(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): Dfun = GradientOfCostFunctionLM, args = (), ftol = selfA._parameters["CostDecrementTolerance"], - maxfev = selfA._parameters["MaximumNumberOfSteps"], + maxfev = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], full_output = True, ) diff --git a/src/daComposant/daAlgorithms/Atoms/incr3dvar.py b/src/daComposant/daAlgorithms/Atoms/incr3dvar.py index f553543..27765bf 100644 --- a/src/daComposant/daAlgorithms/Atoms/incr3dvar.py +++ b/src/daComposant/daAlgorithms/Atoms/incr3dvar.py @@ -67,7 +67,7 @@ def incr3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): J = 1./mpr DeltaJ = 1./mpr Xr = numpy.asarray(selfA._parameters["InitializationPoint"]).reshape((-1,1)) - while abs(DeltaJ) >= selfA._parameters["CostDecrementTolerance"] and iOuter <= selfA._parameters["MaximumNumberOfSteps"]: + while abs(DeltaJ) >= selfA._parameters["CostDecrementTolerance"] and iOuter <= selfA._parameters["MaximumNumberOfIterations"]: # # Inner Loop # ---------- @@ -144,7 +144,7 @@ def incr3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = RecentredBounds(selfA._parameters["Bounds"], Xb), - maxfun = selfA._parameters["MaximumNumberOfSteps"]-1, + maxfun = selfA._parameters["MaximumNumberOfIterations"]-1, factr = selfA._parameters["CostDecrementTolerance"]*1.e14, pgtol = selfA._parameters["ProjectedGradientTolerance"], iprint = selfA._parameters["optiprint"], @@ -158,7 +158,7 @@ def incr3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = RecentredBounds(selfA._parameters["Bounds"], Xb), - maxfun = selfA._parameters["MaximumNumberOfSteps"], + maxfun = selfA._parameters["MaximumNumberOfIterations"], pgtol = selfA._parameters["ProjectedGradientTolerance"], ftol = selfA._parameters["CostDecrementTolerance"], messages = selfA._parameters["optmessages"], @@ -169,7 +169,7 @@ def incr3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = numpy.zeros(Xb.size), fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -180,7 +180,7 @@ def incr3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = numpy.zeros(Xb.size), fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], avextol = selfA._parameters["CostDecrementTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -191,7 +191,7 @@ def incr3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = numpy.zeros(Xb.size), fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, diff --git a/src/daComposant/daAlgorithms/Atoms/psas3dvar.py b/src/daComposant/daAlgorithms/Atoms/psas3dvar.py index dad9e59..ec136bd 100644 --- a/src/daComposant/daAlgorithms/Atoms/psas3dvar.py +++ b/src/daComposant/daAlgorithms/Atoms/psas3dvar.py @@ -123,7 +123,7 @@ def psas3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxfun = selfA._parameters["MaximumNumberOfSteps"]-1, + maxfun = selfA._parameters["MaximumNumberOfIterations"]-1, factr = selfA._parameters["CostDecrementTolerance"]*1.e14, pgtol = selfA._parameters["ProjectedGradientTolerance"], iprint = selfA._parameters["optiprint"], @@ -136,7 +136,7 @@ def psas3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxfun = selfA._parameters["MaximumNumberOfSteps"], + maxfun = selfA._parameters["MaximumNumberOfIterations"], pgtol = selfA._parameters["ProjectedGradientTolerance"], ftol = selfA._parameters["CostDecrementTolerance"], messages = selfA._parameters["optmessages"], @@ -147,7 +147,7 @@ def psas3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -158,7 +158,7 @@ def psas3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], avextol = selfA._parameters["CostDecrementTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -169,7 +169,7 @@ def psas3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, diff --git a/src/daComposant/daAlgorithms/Atoms/std3dvar.py b/src/daComposant/daAlgorithms/Atoms/std3dvar.py index bd70689..c055f77 100644 --- a/src/daComposant/daAlgorithms/Atoms/std3dvar.py +++ b/src/daComposant/daAlgorithms/Atoms/std3dvar.py @@ -127,7 +127,7 @@ def std3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = selfA._parameters["Bounds"], - maxfun = selfA._parameters["MaximumNumberOfSteps"]-1, + maxfun = selfA._parameters["MaximumNumberOfIterations"]-1, factr = selfA._parameters["CostDecrementTolerance"]*1.e14, pgtol = selfA._parameters["ProjectedGradientTolerance"], iprint = selfA._parameters["optiprint"], @@ -141,7 +141,7 @@ def std3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = selfA._parameters["Bounds"], - maxfun = selfA._parameters["MaximumNumberOfSteps"], + maxfun = selfA._parameters["MaximumNumberOfIterations"], pgtol = selfA._parameters["ProjectedGradientTolerance"], ftol = selfA._parameters["CostDecrementTolerance"], messages = selfA._parameters["optmessages"], @@ -152,7 +152,7 @@ def std3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -163,7 +163,7 @@ def std3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], avextol = selfA._parameters["CostDecrementTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -174,7 +174,7 @@ def std3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, diff --git a/src/daComposant/daAlgorithms/Atoms/std4dvar.py b/src/daComposant/daAlgorithms/Atoms/std4dvar.py index cd582a8..b16b1cd 100644 --- a/src/daComposant/daAlgorithms/Atoms/std4dvar.py +++ b/src/daComposant/daAlgorithms/Atoms/std4dvar.py @@ -188,7 +188,7 @@ def std4dvar(selfA, Xb, Y, U, HO, EM, CM, R, B, Q): fprime = GradientOfCostFunction, args = (), bounds = selfA._parameters["Bounds"], - maxfun = selfA._parameters["MaximumNumberOfSteps"]-1, + maxfun = selfA._parameters["MaximumNumberOfIterations"]-1, factr = selfA._parameters["CostDecrementTolerance"]*1.e14, pgtol = selfA._parameters["ProjectedGradientTolerance"], iprint = selfA._parameters["optiprint"], @@ -202,7 +202,7 @@ def std4dvar(selfA, Xb, Y, U, HO, EM, CM, R, B, Q): fprime = GradientOfCostFunction, args = (), bounds = selfA._parameters["Bounds"], - maxfun = selfA._parameters["MaximumNumberOfSteps"], + maxfun = selfA._parameters["MaximumNumberOfIterations"], pgtol = selfA._parameters["ProjectedGradientTolerance"], ftol = selfA._parameters["CostDecrementTolerance"], messages = selfA._parameters["optmessages"], @@ -213,7 +213,7 @@ def std4dvar(selfA, Xb, Y, U, HO, EM, CM, R, B, Q): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -224,7 +224,7 @@ def std4dvar(selfA, Xb, Y, U, HO, EM, CM, R, B, Q): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], avextol = selfA._parameters["CostDecrementTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -235,7 +235,7 @@ def std4dvar(selfA, Xb, Y, U, HO, EM, CM, R, B, Q): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, diff --git a/src/daComposant/daAlgorithms/Atoms/van3dvar.py b/src/daComposant/daAlgorithms/Atoms/van3dvar.py index 5ae73fa..d095d3f 100644 --- a/src/daComposant/daAlgorithms/Atoms/van3dvar.py +++ b/src/daComposant/daAlgorithms/Atoms/van3dvar.py @@ -136,7 +136,7 @@ def van3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = RecentredBounds(selfA._parameters["Bounds"], Xb, BI), - maxfun = selfA._parameters["MaximumNumberOfSteps"]-1, + maxfun = selfA._parameters["MaximumNumberOfIterations"]-1, factr = selfA._parameters["CostDecrementTolerance"]*1.e14, pgtol = selfA._parameters["ProjectedGradientTolerance"], iprint = selfA._parameters["optiprint"], @@ -150,7 +150,7 @@ def van3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): fprime = GradientOfCostFunction, args = (), bounds = RecentredBounds(selfA._parameters["Bounds"], Xb, BI), - maxfun = selfA._parameters["MaximumNumberOfSteps"], + maxfun = selfA._parameters["MaximumNumberOfIterations"], pgtol = selfA._parameters["ProjectedGradientTolerance"], ftol = selfA._parameters["CostDecrementTolerance"], messages = selfA._parameters["optmessages"], @@ -161,7 +161,7 @@ def van3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -172,7 +172,7 @@ def van3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], avextol = selfA._parameters["CostDecrementTolerance"], disp = selfA._parameters["optdisp"], full_output = True, @@ -183,7 +183,7 @@ def van3dvar(selfA, Xb, Y, U, HO, CM, R, B, __storeState = False): x0 = Xini, fprime = GradientOfCostFunction, args = (), - maxiter = selfA._parameters["MaximumNumberOfSteps"], + maxiter = selfA._parameters["MaximumNumberOfIterations"], gtol = selfA._parameters["GradientNormTolerance"], disp = selfA._parameters["optdisp"], full_output = True, diff --git a/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py b/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py index b191c8f..7ad0c03 100644 --- a/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py +++ b/src/daComposant/daAlgorithms/DerivativeFreeOptimization.py @@ -42,7 +42,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): ], ) self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 15000, typecast = int, message = "Nombre maximal de pas d'optimisation", @@ -210,7 +210,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): func = CostFunction, x0 = Xini, args = (self._parameters["QualityCriterion"],), - maxiter = self._parameters["MaximumNumberOfSteps"]-1, + maxiter = self._parameters["MaximumNumberOfIterations"]-1, maxfun = self._parameters["MaximumNumberOfFunctionEvaluations"], xtol = self._parameters["StateVariationTolerance"], ftol = self._parameters["CostDecrementTolerance"], @@ -268,7 +268,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): func = CostFunction, x0 = Xini, args = (self._parameters["QualityCriterion"],), - maxiter = self._parameters["MaximumNumberOfSteps"]-1, + maxiter = self._parameters["MaximumNumberOfIterations"]-1, maxfun = self._parameters["MaximumNumberOfFunctionEvaluations"], xtol = self._parameters["StateVariationTolerance"], ftol = self._parameters["CostDecrementTolerance"], diff --git a/src/daComposant/daAlgorithms/DifferentialEvolution.py b/src/daComposant/daAlgorithms/DifferentialEvolution.py index 0a624a4..df66f0d 100644 --- a/src/daComposant/daAlgorithms/DifferentialEvolution.py +++ b/src/daComposant/daAlgorithms/DifferentialEvolution.py @@ -50,7 +50,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): ], ) self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 15000, typecast = int, message = "Nombre maximal de générations", @@ -157,7 +157,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # len_X = numpy.asarray(Xb).size popsize = round(self._parameters["PopulationSize"]/len_X) - maxiter = min(self._parameters["MaximumNumberOfSteps"],round(self._parameters["MaximumNumberOfFunctionEvaluations"]/(popsize*len_X) - 1)) + maxiter = min(self._parameters["MaximumNumberOfIterations"],round(self._parameters["MaximumNumberOfFunctionEvaluations"]/(popsize*len_X) - 1)) logging.debug("%s Nombre maximal de générations = %i, taille de la population à chaque génération = %i"%(self._name, maxiter, popsize*len_X)) # Hm = HO["Direct"].appliedTo diff --git a/src/daComposant/daAlgorithms/NonLinearLeastSquares.py b/src/daComposant/daAlgorithms/NonLinearLeastSquares.py index 8d5e6d7..ffdbb07 100644 --- a/src/daComposant/daAlgorithms/NonLinearLeastSquares.py +++ b/src/daComposant/daAlgorithms/NonLinearLeastSquares.py @@ -62,7 +62,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): listval = ["State", "Parameters"], ) self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 15000, typecast = int, message = "Nombre maximal de pas d'optimisation", diff --git a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py index c7d743d..808de35 100644 --- a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py +++ b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py @@ -28,7 +28,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): def __init__(self): BasicObjects.Algorithm.__init__(self, "PARTICLESWARMOPTIMIZATION") self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 50, typecast = int, message = "Nombre maximal de pas d'optimisation", @@ -219,7 +219,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # # Minimisation de la fonctionnelle # -------------------------------- - for n in range(self._parameters["MaximumNumberOfSteps"]): + for n in range(self._parameters["MaximumNumberOfIterations"]): for i in range(self._parameters["NumberOfInsects"]) : insect = numpy.ravel(PosInsect[:,i]) rp = numpy.random.uniform(size=nbparam) diff --git a/src/daComposant/daAlgorithms/QuantileRegression.py b/src/daComposant/daAlgorithms/QuantileRegression.py index f806736..6f67538 100644 --- a/src/daComposant/daAlgorithms/QuantileRegression.py +++ b/src/daComposant/daAlgorithms/QuantileRegression.py @@ -44,7 +44,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): listval = ["MMQR",], ) self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 15000, typecast = int, message = "Nombre maximal de pas d'optimisation", @@ -141,7 +141,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): fprime = GradientOfCostFunction, bounds = self._parameters["Bounds"], quantile = self._parameters["Quantile"], - maxfun = self._parameters["MaximumNumberOfSteps"], + maxfun = self._parameters["MaximumNumberOfIterations"], toler = self._parameters["CostDecrementTolerance"], y = Y, ) diff --git a/src/daComposant/daAlgorithms/TabuSearch.py b/src/daComposant/daAlgorithms/TabuSearch.py index b6bf80c..09b4bd8 100644 --- a/src/daComposant/daAlgorithms/TabuSearch.py +++ b/src/daComposant/daAlgorithms/TabuSearch.py @@ -28,7 +28,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): def __init__(self): BasicObjects.Algorithm.__init__(self, "TABUSEARCH") self.defineRequiredParameter( - name = "MaximumNumberOfSteps", + name = "MaximumNumberOfIterations", default = 50, typecast = int, message = "Nombre maximal de pas d'optimisation", @@ -213,7 +213,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): _Best, _qualityBest = _S, _qualityS _TabuList = [] _TabuList.append( _S ) - while _n < self._parameters["MaximumNumberOfSteps"]: + while _n < self._parameters["MaximumNumberOfIterations"]: _n += 1 if len(_TabuList) > self._parameters["LengthOfTabuList"]: _TabuList.pop(0) diff --git a/src/daComposant/daCore/BasicObjects.py b/src/daComposant/daCore/BasicObjects.py index 79db6e7..4b435c6 100644 --- a/src/daComposant/daCore/BasicObjects.py +++ b/src/daComposant/daCore/BasicObjects.py @@ -620,7 +620,7 @@ class Algorithm(object): - CurrentIterationNumber : numéro courant d'itération dans les algorithmes itératifs, à partir de 0 - CurrentOptimum : état optimal courant lors d'itérations - CurrentState : état courant lors d'itérations - - CurrentStepNumber : numéro courant de pas de mesure dans les algorithmes temporels + - CurrentStepNumber : pas courant d'avancement dans les algorithmes en évolution, à partir de 0 - GradientOfCostFunctionJ : gradient de la fonction-coût globale - GradientOfCostFunctionJb : gradient de la partie ébauche de la fonction-coût - GradientOfCostFunctionJo : gradient de la partie observations de la fonction-coût diff --git a/src/daComposant/daCore/Interfaces.py b/src/daComposant/daCore/Interfaces.py index 34508cb..d0f2039 100644 --- a/src/daComposant/daCore/Interfaces.py +++ b/src/daComposant/daCore/Interfaces.py @@ -52,12 +52,26 @@ class GenericCaseViewer(object): self._content = __content self._object = __object self._missing = """raise ValueError("This case requires beforehand to import or define the variable named <%s>. When corrected, remove this command, correct and uncomment the following one.")\n# """ + #------------------------ def _append(self, *args): "Transformation d'une commande individuelle en un enregistrement" raise NotImplementedError() def _extract(self, *args): "Transformation d'enregistrement(s) en commande(s) individuelle(s)" raise NotImplementedError() + #------------------------------ + def _initialize(self, __multilines): + "Permet des pré-conversions automatiques simples de commandes ou clés" + __translation = { + "Study_name" :"StudyName", + "Study_repertory" :"StudyRepertory", + "MaximumNumberOfSteps":"MaximumNumberOfIterations", + "FunctionDict" :"ScriptWithSwitch", + "FUNCTIONDICT_FILE" :"SCRIPTWITHSWITCH_FILE", + } + for k,v in __translation.items(): + __multilines = __multilines.replace(k,v) + return __multilines def _finalize(self, __upa=None): "Enregistrement du final" __hasNotExecute = True @@ -88,8 +102,9 @@ class GenericCaseViewer(object): "Chargement normalisé des commandes" if __filename is not None and os.path.exists(__filename): self._content = open(__filename, 'r').read() + self._content = self._initialize(self._content) elif __content is not None and type(__content) is str: - self._content = __content + self._content = self._initialize(__content) elif __object is not None and type(__object) is dict: self._object = copy.deepcopy(__object) else: @@ -1142,6 +1157,9 @@ class EficasGUI(object): if "EFICAS_ROOT" in os.environ: __EFICAS_ROOT = os.environ["EFICAS_ROOT"] __path_ok = True + elif "EFICAS_NOUVEAU_ROOT" in os.environ: + __EFICAS_ROOT = os.environ["EFICAS_NOUVEAU_ROOT"] + __path_ok = True else: self.__msg += "\nKeyError:\n"+\ " the required environment variable EFICAS_ROOT is unknown.\n"+\ diff --git a/src/daComposant/daCore/NumericObjects.py b/src/daComposant/daCore/NumericObjects.py index 8f1a226..03e833d 100644 --- a/src/daComposant/daCore/NumericObjects.py +++ b/src/daComposant/daCore/NumericObjects.py @@ -868,7 +868,7 @@ def Apply3DVarRecentringOnEnsemble(__EnXn, __EnXf, __Ynpu, __HO, __R, __B, __Bet # selfB = PartialAlgorithm("3DVAR") selfB._parameters["Minimizer"] = "LBFGSB" - selfB._parameters["MaximumNumberOfSteps"] = 15000 + selfB._parameters["MaximumNumberOfIterations"] = 15000 selfB._parameters["CostDecrementTolerance"] = 1.e-7 selfB._parameters["ProjectedGradientTolerance"] = -1 selfB._parameters["GradientNormTolerance"] = 1.e-05 diff --git a/src/daEficas/traduitADAOV7_4_0ToV9_9_0.py b/src/daEficas/traduitADAOV7_4_0ToV9_9_0.py index eb230c2..95d74ae 100644 --- a/src/daEficas/traduitADAOV7_4_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV7_4_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -62,7 +62,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): #Parse les mocles des commandes parseKeywords(jdc.root) - GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) + genereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) # ========================================================================== for command in atraiter: @@ -78,6 +78,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc ) fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) diff --git a/src/daEficas/traduitADAOV7_5_0ToV9_9_0.py b/src/daEficas/traduitADAOV7_5_0ToV9_9_0.py index eb230c2..95d74ae 100644 --- a/src/daEficas/traduitADAOV7_5_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV7_5_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -62,7 +62,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): #Parse les mocles des commandes parseKeywords(jdc.root) - GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) + genereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) # ========================================================================== for command in atraiter: @@ -78,6 +78,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc ) fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) diff --git a/src/daEficas/traduitADAOV7_5_1ToV9_9_0.py b/src/daEficas/traduitADAOV7_5_1ToV9_9_0.py index eb230c2..95d74ae 100644 --- a/src/daEficas/traduitADAOV7_5_1ToV9_9_0.py +++ b/src/daEficas/traduitADAOV7_5_1ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -62,7 +62,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): #Parse les mocles des commandes parseKeywords(jdc.root) - GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) + genereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) # ========================================================================== for command in atraiter: @@ -78,6 +78,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc ) fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) diff --git a/src/daEficas/traduitADAOV7_6_0ToV9_9_0.py b/src/daEficas/traduitADAOV7_6_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV7_6_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV7_6_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV7_7_0ToV9_9_0.py b/src/daEficas/traduitADAOV7_7_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV7_7_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV7_7_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV7_8_0ToV9_9_0.py b/src/daEficas/traduitADAOV7_8_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV7_8_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV7_8_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV8_1_0ToV9_9_0.py b/src/daEficas/traduitADAOV8_1_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV8_1_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV8_1_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV8_2_0ToV9_9_0.py b/src/daEficas/traduitADAOV8_2_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV8_2_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV8_2_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV8_3_0ToV9_9_0.py b/src/daEficas/traduitADAOV8_3_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV8_3_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV8_3_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV8_4_0ToV9_9_0.py b/src/daEficas/traduitADAOV8_4_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV8_4_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV8_4_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV8_5_0ToV9_9_0.py b/src/daEficas/traduitADAOV8_5_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV8_5_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV8_5_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV8_6_0ToV9_9_0.py b/src/daEficas/traduitADAOV8_6_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV8_6_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV8_6_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV9_2_0ToV9_9_0.py b/src/daEficas/traduitADAOV9_2_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV9_2_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV9_2_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV9_3_0ToV9_9_0.py b/src/daEficas/traduitADAOV9_3_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV9_3_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV9_3_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV9_4_0ToV9_9_0.py b/src/daEficas/traduitADAOV9_4_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV9_4_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV9_4_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV9_5_0ToV9_9_0.py b/src/daEficas/traduitADAOV9_5_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV9_5_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV9_5_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV9_6_0ToV9_9_0.py b/src/daEficas/traduitADAOV9_6_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV9_6_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV9_6_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV9_7_0ToV9_9_0.py b/src/daEficas/traduitADAOV9_7_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV9_7_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV9_7_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOV9_8_0ToV9_9_0.py b/src/daEficas/traduitADAOV9_8_0ToV9_9_0.py index 72b96e8..7b13b82 100644 --- a/src/daEficas/traduitADAOV9_8_0ToV9_9_0.py +++ b/src/daEficas/traduitADAOV9_8_0ToV9_9_0.py @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -60,6 +60,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc ) # diff --git a/src/daEficas/traduitADAOsansToV9_9_0.py b/src/daEficas/traduitADAOsansToV9_9_0.py index f6da179..95d74ae 100644 --- a/src/daEficas/traduitADAOsansToV9_9_0.py +++ b/src/daEficas/traduitADAOsansToV9_9_0.py @@ -1,4 +1,4 @@ -#-*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # # Copyright (C) 2008-2022 EDF R&D # @@ -20,14 +20,14 @@ # # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D -import argparse +import argparse # optparse deprecated since Python version 3.2 import sys import re import Traducteur.log as log from Traducteur.load import getJDC, getJDCFromTexte from Traducteur.mocles import parseKeywords -from Traducteur.dictErreurs import GenereErreurPourCommande +from Traducteur.dictErreurs import genereErreurPourCommande from Traducteur.inseremocle import * from Traducteur.movemocle import * from Traducteur.renamemocle import * @@ -62,7 +62,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): #Parse les mocles des commandes parseKeywords(jdc.root) - GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) + genereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict')) # ========================================================================== for command in atraiter: @@ -78,6 +78,7 @@ def traduc(infile=None,outfile=None,texte=None,flog=None): # ========================================================================== fsrc = jdc.getSource() + fsrc = re.sub( "MaximumNumberOfSteps", "MaximumNumberOfIterations", fsrc ) fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc ) fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc ) fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc) diff --git a/test/test6703/Doc_TUI_Exemple_03.py b/test/test6703/Doc_TUI_Exemple_03.py index 8097064..fd45a37 100644 --- a/test/test6703/Doc_TUI_Exemple_03.py +++ b/test/test6703/Doc_TUI_Exemple_03.py @@ -76,7 +76,7 @@ class Test_Adao(unittest.TestCase): Algorithm = '3DVAR', Parameters = { "Bounds":Bounds, - "MaximumNumberOfSteps":100, + "MaximumNumberOfIterations":100, "StoreSupplementaryCalculations":[ "CostFunctionJ", "CurrentState", diff --git a/test/test6704/Doc_TUI_Exemple_03_en_multifonction.py b/test/test6704/Doc_TUI_Exemple_03_en_multifonction.py index ec47a55..a417211 100644 --- a/test/test6704/Doc_TUI_Exemple_03_en_multifonction.py +++ b/test/test6704/Doc_TUI_Exemple_03_en_multifonction.py @@ -82,7 +82,7 @@ class Test_Adao(unittest.TestCase): Algorithm = '3DVAR', Parameters = { "Bounds":Bounds, - "MaximumNumberOfSteps":100, + "MaximumNumberOfIterations":100, "StoreSupplementaryCalculations":[ "CostFunctionJ", "CurrentState", diff --git a/test/test6711/Doc_TUI_Exemple_02_Arguments.py b/test/test6711/Doc_TUI_Exemple_02_Arguments.py index da500d0..0661aa3 100644 --- a/test/test6711/Doc_TUI_Exemple_02_Arguments.py +++ b/test/test6711/Doc_TUI_Exemple_02_Arguments.py @@ -39,7 +39,7 @@ class Test_Adao(unittest.TestCase): Algorithm = '3DVAR', Parameters = { "Minimizer":"CG", - "MaximumNumberOfSteps":3, + "MaximumNumberOfIterations":3, "CostDecrementTolerance":1.e-2, "SetSeed":1234567, "StoreSupplementaryCalculations":[ @@ -67,7 +67,7 @@ class Test_Adao(unittest.TestCase): Algorithm = '3DVAR', Parameters = { "MINIMIZER":"CG", - "maximumnumberofsteps":3, + "MaximumNumberOfIterations":3, "COSTDecrementTOLERANCE":1.e-2, "STORESUPPLEMENTARYCALCULATIONS":[ "CostFunctionJAtCurrentOptimum", diff --git a/test/test6904/Definition_complete_de_cas_3DVAR.py b/test/test6904/Definition_complete_de_cas_3DVAR.py index c039daf..39d1919 100644 --- a/test/test6904/Definition_complete_de_cas_3DVAR.py +++ b/test/test6904/Definition_complete_de_cas_3DVAR.py @@ -80,7 +80,7 @@ class Test_Adao(unittest.TestCase): Algorithm = '3DVAR', # Mots-clé réservé Parameters = { # Dictionnaire "Bounds":Bounds, # Liste de paires de Real ou de None - "MaximumNumberOfSteps":100, # Int >= 0 + "MaximumNumberOfIterations":100, # Int >= 0 "CostDecrementTolerance":1.e-7, # Real > 0 "StoreSupplementaryCalculations":[# Liste de mots-clés réservés "CostFunctionJAtCurrentOptimum", diff --git a/test/test6904/Definition_complete_de_cas_NLLS.py b/test/test6904/Definition_complete_de_cas_NLLS.py index f584e48..c73c430 100644 --- a/test/test6904/Definition_complete_de_cas_NLLS.py +++ b/test/test6904/Definition_complete_de_cas_NLLS.py @@ -80,7 +80,7 @@ class Test_Adao(unittest.TestCase): Algorithm = 'NonLinearLeastSquares', # Mots-clé réservé Parameters = { # Dictionnaire "Bounds":Bounds, # Liste de paires de Real ou de None - "MaximumNumberOfSteps":100, # Int >= 0 + "MaximumNumberOfIterations":100, # Int >= 0 "CostDecrementTolerance":1.e-7, # Real > 0 "StoreSupplementaryCalculations":[# Liste de mots-clés réservés "CostFunctionJAtCurrentOptimum", diff --git a/test/test6905/test914_Xternal_3_Variables.py b/test/test6905/test914_Xternal_3_Variables.py index 3842ba7..22075a8 100644 --- a/test/test6905/test914_Xternal_3_Variables.py +++ b/test/test6905/test914_Xternal_3_Variables.py @@ -47,5 +47,5 @@ for i in range(dimension-1): AlgorithmParameters = { "SetSeed" : 1000, "Minimizer" : "LBFGSB", - "MaximumNumberOfSteps" : 15, + "MaximumNumberOfIterations" : 15, } -- 2.39.2