Salome HOME
Supplementary correction for pickle transmission
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Fri, 16 Nov 2018 08:25:26 +0000 (09:25 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Fri, 16 Nov 2018 08:25:26 +0000 (09:25 +0100)
examples/daSalome/test005_ADAO_scripts_for_JDC.py
examples/daSalome/test006_Observers_Observation_Operator.py
examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py

index 6938bc85ac92de0ac9251f6cd762200aedd257fe..e0ae6fa2a4187583e59dc41456b7ef18fbaba059 100644 (file)
@@ -20,8 +20,9 @@
 #
 # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
 
-import numpy
-import logging
+import numpy, logging, codecs, pickle
+def loads( data ):
+    return pickle.loads(codecs.decode(data.encode(), "base64"))
 logging.info("ComputationFunctionNode: Begin")
 # ==============================================================================
 # Input data and parameters: all is in the required input variable
@@ -37,7 +38,7 @@ logging.info("ComputationFunctionNode: Begin")
 method = ""
 for param in computation["specificParameters"]:
     if param["name"] == "method":
-        method = param["value"]
+        method = loads(param["value"])
 logging.info("ComputationFunctionNode: Found method is \'%s\'"%method)
 #
 # Recovering the current control state X
index 099459db27a6f35831da12a56b40006e14ac9c91..4f81cbafef74122f3b4ade304bed420dc212cba7 100644 (file)
 #
 # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
 
-import numpy
 import time
-import logging
+import numpy, logging, codecs, pickle
+def loads( data ):
+    return pickle.loads(codecs.decode(data.encode(), "base64"))
 logging.info("ComputationFunctionNode: Begin")
 # ==============================================================================
 # Input data and parameters: all is in the required input variable
@@ -38,7 +39,7 @@ logging.info("ComputationFunctionNode: Begin")
 method = ""
 for param in computation["specificParameters"]:
     if param["name"] == "method":
-        method = param["value"]
+        method = loads(param["value"])
 logging.info("ComputationFunctionNode: Found method is \'%s\'"%method)
 #
 # Recovering the current control state X
index 2d052bbdb913fb3b99f91918c5abd5fe2208e783..d8009eaa13df4d4e04205f46f5c9ced4f2e5d115 100644 (file)
@@ -31,7 +31,9 @@ __author__ = "Jean-Philippe ARGAUD"
 # ==============================================================================
 #
 import Physical_simulation_functions
-import numpy, logging
+import numpy, logging, codecs, pickle
+def loads( data ):
+    return pickle.loads(codecs.decode(data.encode(), "base64"))
 #
 # -----------------------------------------------------------------------
 # SALOME input data and parameters: all information are the required input
@@ -47,7 +49,7 @@ import numpy, logging
 method = ""
 for param in computation["specificParameters"]:
     if param["name"] == "method":
-        method = param["value"]
+        method = loads(param["value"])
 logging.info("ComputationFunctionNode: Found method is \'%s\'"%method)
 #
 # Loading the H operator functions from external definitions