History

tests/: array_from_file to look for file in tests/

Paul Brossier committed 13 years ago

Commit a4cc8e51 parent 0d222ee3 files · +11 −8Browse files

Showing the changes to python (3 of 3 files). Show all

Unified · Split

3 files
  1. python/tests/test_filter.py +1 −4
  2. python/tests/test_filterbank.py +1 −4
  3. python/tests/utils.py +9 −0
python/tests/test_filter.py+1−4
@@ -3,10 +3,7 @@ · 2 unmodified lines
3from numpy.testing import TestCase, assert_equal, assert_almost_equal3from numpy.testing import TestCase, assert_equal, assert_almost_equal
4from aubio import fvec, digital_filter4from aubio import fvec, digital_filter
5from numpy import array5from numpy import array
6 6from utils import array_from_text_file
7def array_from_text_file(filename, dtype = 'float'):
8 return array([line.split() for line in open(filename).readlines()],
9 dtype = dtype)
10 7
11class aubio_filter_test_case(TestCase):8class aubio_filter_test_case(TestCase):
12 9
python/tests/test_filterbank.py+1−4
@@ -6,10 +6,7 @@ from numpy import random · 5 unmodified lines
6from math import pi6from math import pi
7from numpy import array7from numpy import array
8from aubio import cvec, filterbank8from aubio import cvec, filterbank
9 9from utils import array_from_text_file
10def array_from_text_file(filename, dtype = 'float'):
11 return array([line.split() for line in open(filename).readlines()],
12 dtype = dtype)
13 10
14class aubio_filterbank_test_case(TestCase):11class aubio_filterbank_test_case(TestCase):
15 12
python/tests/utils.py+9−0
@@ -0,0 +1,9 @@
1#! /usr/bin/env python
2
3def 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t