Showing the changes to python (3 of 3 files). Show all
Unified · Split
| @@ -3,10 +3,7 @@ · 2 unmodified lines | |||
| 3 | from numpy.testing import TestCase, assert_equal, assert_almost_equal | 3 | from numpy.testing import TestCase, assert_equal, assert_almost_equal |
| 4 | from aubio import fvec, digital_filter | 4 | from aubio import fvec, digital_filter |
| 5 | from numpy import array | 5 | from numpy import array |
| 6 | 6 | from utils import array_from_text_file | |
| 7 | def array_from_text_file(filename, dtype = 'float'): | ||
| 8 | return array([line.split() for line in open(filename).readlines()], | ||
| 9 | dtype = dtype) | ||
| 10 | 7 | ||
| 11 | class aubio_filter_test_case(TestCase): | 8 | class aubio_filter_test_case(TestCase): |
| 12 | 9 | ||
| @@ -6,10 +6,7 @@ from numpy import random · 5 unmodified lines | |||
| 6 | from math import pi | 6 | from math import pi |
| 7 | from numpy import array | 7 | from numpy import array |
| 8 | from aubio import cvec, filterbank | 8 | from aubio import cvec, filterbank |
| 9 | 9 | from utils import array_from_text_file | |
| 10 | def array_from_text_file(filename, dtype = 'float'): | ||
| 11 | return array([line.split() for line in open(filename).readlines()], | ||
| 12 | dtype = dtype) | ||
| 13 | 10 | ||
| 14 | class aubio_filterbank_test_case(TestCase): | 11 | class aubio_filterbank_test_case(TestCase): |
| 15 | 12 | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | #! /usr/bin/env python | ||
| 2 | |||
| 3 | def array_from_text_file(filename, dtype = 'float'): | ||
| 4 | import os.path | ||
| 5 | from numpy import array | ||
| 6 | filename = os.path.join(os.path.dirname(__file__), filename) | ||
| 7 | return array([line.split() for line in open(filename).readlines()], | ||
| 8 | dtype = dtype) | ||
| 9 | |||