From b72d8a9d5f2faa4394e2e3b9687104b9267d2056 Mon Sep 17 00:00:00 2001 From: Wen Guan Date: Mon, 18 Nov 2024 22:03:37 +0100 Subject: [PATCH] add function to convert MapResult to dict --- workflow/lib/idds/iworkflow/asyncresult.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/workflow/lib/idds/iworkflow/asyncresult.py b/workflow/lib/idds/iworkflow/asyncresult.py index 85bc7666..4105dc6c 100644 --- a/workflow/lib/idds/iworkflow/asyncresult.py +++ b/workflow/lib/idds/iworkflow/asyncresult.py @@ -146,6 +146,13 @@ def set_result(self, name=None, args=None, key=None, value=None, verbose=False): def get_all_results(self): return self._results + def get_dict_results(self): + return {'results': self._results, 'name_results': self._name_results} + + def set_from_dict_results(self, results): + self._results = results.get('results', {}) + self._name_results = results.get('name_results', {}) + class AsyncResult(Base):