From: Guillaume Pellerin Date: Sat, 26 Apr 2014 10:47:18 +0000 (+0200) Subject: Fix container json serializer to return non numpyarray data X-Git-Tag: 0.5.5~1^2~41 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3d42e56d0da85a1e1;p=timeside.git Fix container json serializer to return non numpyarray data --- 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()],