]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Simplifying ADAO interface to results
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 3 Jan 2015 20:54:37 +0000 (21:54 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 3 Jan 2015 20:54:37 +0000 (21:54 +0100)
src/daComposant/daCore/AssimilationStudy.py
src/daSalome/daYacsIntegration/daOptimizerLoop.py

index c9817152fcfc8d962854e6c03f44490d54b6d88f..68deecf3586ccf89bf1cd31afd407c5b1e0f891c 100644 (file)
@@ -1024,15 +1024,29 @@ class AssimilationStudy:
         log = logging.getLogger()
         log.setLevel( logging.WARNING )
 
+    def __dir__(self):
+        # return set(self.__dict__.keys() + dir(self.__class__))
+        return ['get', '__doc__', '__init__', '__module__']
+
     def prepare_to_pickle(self):
         """
         Retire les variables non pickelisables
         """
-        self.__algorithmFile = None
-        self.__diagnosticFile = None
-        self.__HO  = {}
-        self.__EM  = {}
-        self.__CM  = {}
+        del self.__B
+        del self.__CM # non pickelisable
+        del self.__EM # non pickelisable
+        del self.__HO # non pickelisable
+        del self.__Parameters
+        del self.__Q
+        del self.__R
+        del self.__U
+        del self.__X
+        del self.__Xb
+        del self.__Y
+        del self.__algorithmFile # non pickelisable
+        del self.__algorithmName
+        del self.__diagnosticFile # non pickelisable
+        self.__class__.__doc__ = ""
 
 # ==============================================================================
 if __name__ == "__main__":
index f3941e0033755bb2dd579def5c1b644f9b405d84..9b91b294d6b4c4f1ecc22213f133e74e05e52255 100644 (file)
@@ -432,11 +432,10 @@ class AssimilationAlgorithm_asynch(SALOMERuntime.OptimizerAlgASync):
       print '-'*60
 
   def getAlgoResult(self):
-    #print "getAlgoResult"
-    self.ADD.prepare_to_pickle()
-    # Remove data observers cannot pickle assimilation study object
+    # Remove data observers, required to pickle assimilation study object
     for observer_name in self.da_study.observers_dict.keys():
       self.ADD.removeDataObserver(observer_name, self.obs)
+    self.ADD.prepare_to_pickle()
     result = pickle.dumps(self.da_study) # Careful : pickle is mandatory over cPickle !
     return result