]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Improvements for classification of algorithms
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 12 Apr 2020 14:29:44 +0000 (16:29 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 12 Apr 2020 14:29:44 +0000 (16:29 +0200)
src/daComposant/daAlgorithms/AdjointTest.py
src/daComposant/daAlgorithms/Blue.py
src/daComposant/daAlgorithms/LinearLeastSquares.py
src/daComposant/daAlgorithms/NonLinearLeastSquares.py
src/daComposant/daCore/BasicObjects.py

index 634e6d9d1e8234dc5f910f4c4b0ad380c4dbc839..31561ba1f80d75cfc8139bd2cf765d47fadca622 100644 (file)
@@ -84,6 +84,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             mandatory= ("Xb", "HO" ),
             optional = ("Y", ),
             )
+        self.setAttributes(tags=(
+            "Checking",
+            ))
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run(Parameters, Xb, Y, R, B, Q)
index cceab0c86581d42f99d3b0c11f271e4f2a957750..d8d5b86460fa26fef9cb8cafce867e6973f7ecaa 100644 (file)
@@ -97,6 +97,11 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         self.requireInputArguments(
             mandatory= ("Xb", "Y", "HO", "R", "B"),
             )
+        self.setAttributes(tags=(
+            "DataAssimilation",
+            "Linear",
+            "Filter",
+            ))
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run(Parameters, Xb, Y, R, B, Q)
index e8af931a9ea25552451e41d0faca6ef3534af557..f36aa16add8877a36e71e2bfc65fb70348c6a656 100644 (file)
@@ -58,6 +58,11 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         self.requireInputArguments(
             mandatory= ("Y", "HO", "R"),
             )
+        self.setAttributes(tags=(
+            "Optimization",
+            "Linear",
+            "Variational",
+            ))
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run(Parameters, Xb, Y, R, B, Q)
index dc59068a9939d931290c9ab64a93301eda9eea45..231764c14cdf3e6cb73ec9c9f35261f7a9e0a6dd 100644 (file)
@@ -103,6 +103,11 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         self.requireInputArguments(
             mandatory= ("Xb", "Y", "HO", "R"),
             )
+        self.setAttributes(tags=(
+            "Optimization",
+            "NonLinear",
+            "Variational",
+            ))
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run(Parameters, Xb, Y, R, B, Q)
index 9535f5b06553c43c4f54cd6bbca3f6224dcbf22d..d89f9b23fff5482b1c6d242f752bff46f0e09efa 100644 (file)
@@ -331,7 +331,7 @@ class Operator(object):
         if self.__Matrix is not None:
             self.__addOneMatrixCall()
             mValue = [self.__Matrix,]
-        elif ValueForMethodForm is not "UnknownVoidValue": # Ne pas utiliser "None"
+        elif not isinstance(ValueForMethodForm,str) or ValueForMethodForm != "UnknownVoidValue": # Ne pas utiliser "None"
             mValue = []
             if argsAsSerie:
                 self.__addOneMethodCall( len(ValueForMethodForm) )
@@ -624,7 +624,10 @@ class Algorithm(object):
         self._name = str( name )
         self._parameters = {"StoreSupplementaryCalculations":[]}
         self.__required_parameters = {}
-        self.__required_inputs = {"RequiredInputValues":{"mandatory":(), "optional":()}}
+        self.__required_inputs = {
+            "RequiredInputValues":{"mandatory":(), "optional":()},
+            "ClassificationTags":[],
+            }
         self.__variable_names_not_public = {"nextStep":False} # Duplication dans AlgorithmAndParameters
         self.__canonical_parameter_name = {} # Correspondance "lower"->"correct"
         self.__canonical_stored_name = {}    # Correspondance "lower"->"correct"
@@ -882,11 +885,25 @@ class Algorithm(object):
 
     def requireInputArguments(self, mandatory=(), optional=()):
         """
-        Permet d'imposer des arguments requises en entrée
+        Permet d'imposer des arguments de calcul requis en entrée.
         """
         self.__required_inputs["RequiredInputValues"]["mandatory"] = tuple( mandatory )
         self.__required_inputs["RequiredInputValues"]["optional"]  = tuple( optional )
 
+    def getInputArguments(self):
+        """
+        Permet d'obtenir les listes des arguments de calcul requis en entrée.
+        """
+        return self.__required_inputs["RequiredInputValues"]["mandatory"], self.__required_inputs["RequiredInputValues"]["optional"]
+
+    def setAttributes(self, tags=()):
+        """
+        Permet d'adjoindre des attributs comme les tags de classification.
+        Renvoie la liste actuelle dans tous les cas.
+        """
+        self.__required_inputs["ClassificationTags"].extend( tags )
+        return self.__required_inputs["ClassificationTags"]
+
     def __setParameters(self, fromDico={}, reset=False):
         """
         Permet de stocker les paramètres reçus dans le dictionnaire interne.