From 3d42e56d0da85a1e1aec754ac9caeadd2b9e6508 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sat, 26 Apr 2014 12:47:18 +0200 Subject: [PATCH] Fix container json serializer to return non numpyarray data --- timeside/analyzer/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/timeside/analyzer/core.py b/timeside/analyzer/core.py index 978b96d..65f0247 100644 --- a/timeside/analyzer/core.py +++ b/timeside/analyzer/core.py @@ -924,6 +924,9 @@ class AnalyzerResultContainer(dict): if isinstance(obj, numpy.ndarray): return {'numpyArray': obj.tolist(), 'dtype': obj.dtype.__str__()} + else: + return {'value': obj.tolist(), + 'dtype': obj.dtype.__str__()} raise TypeError(repr(obj) + " is not JSON serializable") json_str = json.dumps([res.as_dict() for res in self.values()], -- 2.39.5