]> git.parisson.com Git - timeside.git/commitdiff
Fix container json serializer to return non numpyarray data
authorGuillaume Pellerin <yomguy@parisson.com>
Sat, 26 Apr 2014 10:47:18 +0000 (12:47 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Sat, 26 Apr 2014 10:47:18 +0000 (12:47 +0200)
timeside/analyzer/core.py

index 978b96d7202de5f940d6b5be400fee12c82b0971..65f024703cc0ad67ee8e223b42fce2a933224d09 100644 (file)
@@ -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()],