From c33a06826dbbf35e7818d571751208f8be19c541 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Mon, 30 Sep 2013 11:42:37 +0200 Subject: [PATCH] Fix bug in AnalyzerResult : numpy.array type have to be considered but it is no more in numpy_data_type --- timeside/analyzer/core.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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' % -- 2.39.5