from numpy.testing import TestCase, assert_equal, assert_almost_equal
from aubio import fvec, digital_filter
from numpy import array
-
-def array_from_text_file(filename, dtype = 'float'):
- return array([line.split() for line in open(filename).readlines()],
- dtype = dtype)
+from utils import array_from_text_file
class aubio_filter_test_case(TestCase):
from math import pi
from numpy import array
from aubio import cvec, filterbank
-
-def array_from_text_file(filename, dtype = 'float'):
- return array([line.split() for line in open(filename).readlines()],
- dtype = dtype)
+from utils import array_from_text_file
class aubio_filterbank_test_case(TestCase):
--- /dev/null
+#! /usr/bin/env python
+
+def array_from_text_file(filename, dtype = 'float'):
+ import os.path
+ from numpy import array
+ filename = os.path.join(os.path.dirname(__file__), filename)
+ return array([line.split() for line in open(filename).readlines()],
+ dtype = dtype)
+