From 0d0c1f55398b2ae2f91d75547d9eda7d34fe1ae5 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 19 Jun 2013 13:11:54 +0200 Subject: [PATCH] fix empty argument for AnalyzerResultContainer, fix aubio_specdesc.results, add results to api --- setup.py | 1 + timeside/analyzer/aubio_specdesc.py | 2 +- timeside/analyzer/core.py | 4 +++- timeside/api.py | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2b207c2..d5dae27 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ setup( 'numpy>=1.6.2', 'mutagen', 'pil', + 'scipy', ], platforms=['OS Independent'], license='Gnu Public License V2', diff --git a/timeside/analyzer/aubio_specdesc.py b/timeside/analyzer/aubio_specdesc.py index b9a1c10..6c52031 100644 --- a/timeside/analyzer/aubio_specdesc.py +++ b/timeside/analyzer/aubio_specdesc.py @@ -88,4 +88,4 @@ class AubioSpecdesc(Processor): container.add_result([specdesc, specdesc_mean, specdesc_median]) - return AnalyzerResultContainer() + return container diff --git a/timeside/analyzer/core.py b/timeside/analyzer/core.py index 1f2f0fe..b1553b1 100644 --- a/timeside/analyzer/core.py +++ b/timeside/analyzer/core.py @@ -79,7 +79,9 @@ class AnalyzerResult(dict): class AnalyzerResultContainer(object): - def __init__(self, analyzer_results = []): + def __init__(self, analyzer_results=None): + if analyzer_results is None: + analyzer_results = [] self.results = analyzer_results def __getitem__(self, i): diff --git a/timeside/api.py b/timeside/api.py index 6185286..116cc74 100644 --- a/timeside/api.py +++ b/timeside/api.py @@ -207,6 +207,10 @@ class IValueAnalyzer(IAnalyzer): """Return the final result of the analysis performed over the data passed by repeatedly calling process()""" + def results(): + """Return the final results of the analysis performed over the data passed by + repeatedly calling process()""" + def __str__(self): """Return a human readable string containing both result and unit ('5.30dB', '4.2s', etc...)""" -- 2.39.5