From: Thomas Fillon Date: Mon, 30 Sep 2013 09:42:37 +0000 (+0200) Subject: Fix bug in AnalyzerResult : numpy.array type have to be considered but it is no more... X-Git-Tag: 0.5.0~63 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c33a06826dbbf35e7818d571751208f8be19c541;p=timeside.git Fix bug in AnalyzerResult : numpy.array type have to be considered but it is no more in numpy_data_type --- diff --git a/timeside/analyzer/core.py b/timeside/analyzer/core.py index 68d980e..4918657 100644 --- a/timeside/analyzer/core.py +++ b/timeside/analyzer/core.py @@ -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' %