From: Jean-Philippe ARGAUD Date: Fri, 16 Nov 2018 08:25:26 +0000 (+0100) Subject: Supplementary correction for pickle transmission X-Git-Tag: V9_2_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=07365341ee7e6cd58201f08bf123af605b1b7e50;p=modules%2Fadao.git Supplementary correction for pickle transmission --- diff --git a/examples/daSalome/test005_ADAO_scripts_for_JDC.py b/examples/daSalome/test005_ADAO_scripts_for_JDC.py index 6938bc8..e0ae6fa 100644 --- a/examples/daSalome/test005_ADAO_scripts_for_JDC.py +++ b/examples/daSalome/test005_ADAO_scripts_for_JDC.py @@ -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 diff --git a/examples/daSalome/test006_Observers_Observation_Operator.py b/examples/daSalome/test006_Observers_Observation_Operator.py index 099459d..4f81cba 100644 --- a/examples/daSalome/test006_Observers_Observation_Operator.py +++ b/examples/daSalome/test006_Observers_Observation_Operator.py @@ -20,9 +20,10 @@ # # 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 diff --git a/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py b/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py index 2d052bb..d8009ea 100644 --- a/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py +++ b/examples/daSkeletons/External_data_definition_by_scripts/Script_ObservationOperator_H.py @@ -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