From 45f8bc76529b8dcf99716d64c07924a75f4c598d Mon Sep 17 00:00:00 2001 From: Jose Borreguero <borreguero@gmail.com> Date: Tue, 5 Dec 2017 16:09:43 -0500 Subject: [PATCH] Refs #21335 jsonify out of the conditional --- .../plugins/algorithms/BASISReduction.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Framework/PythonInterface/plugins/algorithms/BASISReduction.py b/Framework/PythonInterface/plugins/algorithms/BASISReduction.py index 22662d9a167..e30b621f3a4 100644 --- a/Framework/PythonInterface/plugins/algorithms/BASISReduction.py +++ b/Framework/PythonInterface/plugins/algorithms/BASISReduction.py @@ -635,15 +635,14 @@ class BASISReduction(PythonAlgorithm): ws_name: str Name of the workspace from which to retrieve and modify the logs """ + def jsonify(value): + r"""Cast non-standard objects to their closest standard + representation to enable JSON serialiation""" + if isinstance(value, np.ndarray): + return value.tolist() + return value if self._as_json is None: - self._as_json = {'properties': {}} - #self._as_json = json.loads(str(self)) - def jsonify(value): - r"""Cast non-standard objects to their closest standard - representation to enable JSON serialiation""" - if isinstance(value, np.ndarray): - return value.tolist() - return value + self._as_json = json.loads(str(self)) # Force serialization of the following properties even if having # their default values forced = {name: jsonify(self.getProperty(name).value) -- GitLab