]> git.parisson.com Git - timeside.git/commitdiff
Fix bug in AnalyzerResult : numpy.array type have to be considered but it is no more...
authorThomas Fillon <thomas@parisson.com>
Mon, 30 Sep 2013 09:42:37 +0000 (11:42 +0200)
committerThomas Fillon <thomas@parisson.com>
Mon, 30 Sep 2013 09:42:37 +0000 (11:42 +0200)
timeside/analyzer/core.py

index 68d980e63aa746dc0fbddd5e42b5c142d82d015f..49186577fc385d66ca63a6e741a167813c4a2e0f 100644 (file)
@@ -555,7 +555,7 @@ class AnalyzerMetadata(MetadataObject):
     """
     Object that contains the metadata and parameters of an analyzer process
 
-    Metadata
+    Attributes
     ----------
     id : string
     name : string
@@ -597,10 +597,7 @@ class AnalyzerResult(object):
             self.metadata = metadata
 
         # Define Data
-        if data is None:
-            self.data = []
-        else:
-            self.data = data
+        self.data = data
 
     def __setattr__(self, name, value):
 
@@ -612,7 +609,7 @@ class AnalyzerResult(object):
             if type(value) is list:
                 value = numpy.array(value)
             # serialize using numpy
-            if type(value) in numpy_data_types:
+            if type(value) in numpy_data_types+[numpy.ndarray]:
                 value = value.tolist()
             if type(value) not in [list, str, int, long, float, complex, type(None)] + numpy_data_types:
                 raise TypeError('AnalyzerResult can not accept type %s' %