]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Improving user messages for adjoint and gradient checkers
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Wed, 20 Mar 2013 09:39:20 +0000 (10:39 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Wed, 20 Mar 2013 09:39:20 +0000 (10:39 +0100)
src/daComposant/daAlgorithms/AdjointTest.py
src/daComposant/daAlgorithms/GradientTest.py

index 7276b7b33ca38b55dfc0d54d514dc97599ee0410..a7e803313b1d68a7f229d8c89c3db90a38a04bfe 100644 (file)
@@ -129,9 +129,12 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         else:
             __doc__ = ""
         #
-        msgs  = "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
-        msgs += "             " + self._parameters["ResultTitle"] + "\n"
-        msgs += "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
+        if len(self._parameters["ResultTitle"]) > 0:
+            msgs  = "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
+            msgs += "             " + self._parameters["ResultTitle"] + "\n"
+            msgs += "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
+        else:
+            msgs  = ""
         msgs += __doc__
         #
         msg = "  i   Alpha     ||X||       ||Y||       ||dX||        R(Alpha)  "
index aa547a75b9a4d9cf1ba49bb03c850d82f275a184..36bce3f54998abf824a765e5fbf6883be8c31330 100644 (file)
@@ -159,9 +159,12 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         else:
             __doc__ = ""
         #
-        msgs  = "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
-        msgs += "             " + self._parameters["ResultTitle"] + "\n"
-        msgs += "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
+        if len(self._parameters["ResultTitle"]) > 0:
+            msgs  = "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
+            msgs += "             " + self._parameters["ResultTitle"] + "\n"
+            msgs += "         ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
+        else:
+            msgs  = ""
         msgs += __doc__
         #
         msg = "  i   Alpha       ||X||    ||F(X)||  ||F(X+dX)||    ||dX||  ||F(X+dX)-F(X)||   ||F(X+dX)-F(X)||/||dX||      R(Alpha)  "