From 4c01c0fe325947e7a0a6141f28755f4995959b3e Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 25 Dec 2009 05:09:41 +0100 Subject: [PATCH] test_*.py: use aubio module --- interfaces/python/aubio/__init__.py | 1 + interfaces/python/test_aubio.py | 7 ++----- interfaces/python/test_cvec.py | 2 +- interfaces/python/test_fft.py | 3 +-- interfaces/python/test_filter.py | 3 +-- interfaces/python/test_filterbank.py | 3 +-- interfaces/python/test_fvec.py | 3 +-- interfaces/python/test_onsetdetection.py | 2 +- interfaces/python/test_phasevoc.py | 3 +-- 9 files changed, 10 insertions(+), 17 deletions(-) diff --git a/interfaces/python/aubio/__init__.py b/interfaces/python/aubio/__init__.py index e13766a7..85c71808 100644 --- a/interfaces/python/aubio/__init__.py +++ b/interfaces/python/aubio/__init__.py @@ -1,4 +1,5 @@ import numpy +from _aubio import * class fvec(numpy.ndarray): diff --git a/interfaces/python/test_aubio.py b/interfaces/python/test_aubio.py index 0af59566..9af5ba2f 100644 --- a/interfaces/python/test_aubio.py +++ b/interfaces/python/test_aubio.py @@ -1,13 +1,10 @@ from numpy.testing import TestCase, run_module_suite -from numpy.testing import assert_equal -from _aubio import * -from numpy import array class aubiomodule_test_case(TestCase): - def setUp(self): + def test_import(self): """ try importing aubio """ - + import aubio if __name__ == '__main__': from unittest import main diff --git a/interfaces/python/test_cvec.py b/interfaces/python/test_cvec.py index 99051a98..86916464 100644 --- a/interfaces/python/test_cvec.py +++ b/interfaces/python/test_cvec.py @@ -1,6 +1,6 @@ from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal -from _aubio import cvec +from aubio import cvec from numpy import array, shape, pi class aubio_cvec_test_case(TestCase): diff --git a/interfaces/python/test_fft.py b/interfaces/python/test_fft.py index 4ac92f15..eb20c41f 100644 --- a/interfaces/python/test_fft.py +++ b/interfaces/python/test_fft.py @@ -1,8 +1,7 @@ from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal # WARNING: numpy also has an fft object -from _aubio import fft, cvec -from aubio import fvec +from aubio import fvec, fft, cvec from numpy import array, shape from math import pi diff --git a/interfaces/python/test_filter.py b/interfaces/python/test_filter.py index 443e21f1..5aae9ff2 100644 --- a/interfaces/python/test_filter.py +++ b/interfaces/python/test_filter.py @@ -1,7 +1,6 @@ from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal -from _aubio import * -from aubio import fvec +from aubio import fvec, digital_filter from numpy import array def array_from_text_file(filename, dtype = 'float'): diff --git a/interfaces/python/test_filterbank.py b/interfaces/python/test_filterbank.py index e95e87c6..483ab0e4 100644 --- a/interfaces/python/test_filterbank.py +++ b/interfaces/python/test_filterbank.py @@ -1,8 +1,7 @@ from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal from numpy import array, shape -from _aubio import * -#from aubio import cvec +from aubio import cvec, filterbank class aubio_filter_test_case(TestCase): diff --git a/interfaces/python/test_fvec.py b/interfaces/python/test_fvec.py index bd94af66..3077ffe6 100644 --- a/interfaces/python/test_fvec.py +++ b/interfaces/python/test_fvec.py @@ -1,7 +1,6 @@ from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal -from _aubio import * -from aubio import fvec +from aubio import fvec, zero_crossing_rate, alpha_norm, min_removal from numpy import array, shape class aubio_fvec_test_case(TestCase): diff --git a/interfaces/python/test_onsetdetection.py b/interfaces/python/test_onsetdetection.py index 23b70ba6..895ee494 100644 --- a/interfaces/python/test_onsetdetection.py +++ b/interfaces/python/test_onsetdetection.py @@ -1,7 +1,7 @@ from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal # WARNING: numpy also has an fft object -from _aubio import specdesc, cvec +from aubio import specdesc, cvec from numpy import array, shape, arange, zeros, log from math import pi diff --git a/interfaces/python/test_phasevoc.py b/interfaces/python/test_phasevoc.py index e1153d50..71b3e140 100644 --- a/interfaces/python/test_phasevoc.py +++ b/interfaces/python/test_phasevoc.py @@ -1,7 +1,6 @@ from numpy.testing import TestCase, run_module_suite from numpy.testing import assert_equal, assert_almost_equal -from aubio import fvec -from _aubio import * +from aubio import fvec, cvec, pvoc from numpy import array, shape class aubio_pvoc_test_case(TestCase): -- 2.26.2