Changeset 08d07ce for python/tests
- Timestamp:
- Jun 29, 2019, 1:14:08 PM (5 years ago)
- Branches:
- feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
- Children:
- 3a83821
- Parents:
- 9279ba0 (diff), 2244f00 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- python/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_hztomel.py
r9279ba0 r08d07ce 5 5 from numpy.testing import assert_equal, assert_almost_equal 6 6 from _tools import assert_warns 7 from utils import is32bit 7 8 import numpy as np 8 9 import aubio … … 10 11 from aubio import hztomel, meltohz 11 12 from aubio import hztomel_htk, meltohz_htk 12 13 13 14 14 class aubio_hztomel_test_case(TestCase): … … 18 18 assert_almost_equal(hztomel(400. / 3.), 2., decimal=5) 19 19 assert_almost_equal(hztomel(1000. / 3), 5.) 20 assert_equal(hztomel(200.), 3.) 20 # on 32bit, some of these tests fails unless compiling with -ffloat-store 21 try: 22 assert_equal(hztomel(200.), 3.) 23 except AssertionError: 24 if not is32bit(): raise 25 assert_almost_equal(hztomel(200.), 3., decimal=5) 21 26 assert_almost_equal(hztomel(1000.), 15) 22 assert_almost_equal(hztomel(6400), 42 )23 assert_almost_equal(hztomel(40960), 69 )27 assert_almost_equal(hztomel(6400), 42, decimal=5) 28 assert_almost_equal(hztomel(40960), 69, decimal=5) 24 29 25 30 for m in np.linspace(0, 1000, 100): … … 29 34 assert_equal(meltohz(0.), 0.) 30 35 assert_almost_equal(meltohz(2), 400. / 3., decimal=4) 31 assert_equal(meltohz(3.), 200.) 36 try: 37 assert_equal(meltohz(3.), 200.) 38 except AssertionError: 39 if not is32bit(): raise 40 assert_almost_equal(meltohz(3.), 200., decimal=5) 32 41 assert_almost_equal(meltohz(5), 1000. / 3., decimal=4) 33 42 assert_almost_equal(meltohz(15), 1000., decimal=4) -
python/tests/test_phasevoc.py
r9279ba0 r08d07ce 2 2 3 3 from numpy.testing import TestCase, assert_equal, assert_array_less 4 from _tools import parametrize 4 from _tools import parametrize, skipTest 5 5 from aubio import fvec, cvec, pvoc, float_type 6 6 import numpy as np … … 52 52 assert_equal (s.phas[s.phas < 0], -np.pi) 53 53 assert_equal (np.abs(s.phas[np.abs(s.phas) != np.pi]), 0) 54 s elf.skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \54 skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \ 55 55 + 'This is expected when using fftw3 on powerpc.') 56 56 assert_equal ( r, 0.) -
python/tests/utils.py
r9279ba0 r08d07ce 4 4 import re 5 5 import glob 6 import struct 6 7 import numpy as np 7 8 from tempfile import mkstemp 8 9 9 10 DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav' 11 12 def is32bit(): 13 return struct.calcsize("P") * 8 == 32 10 14 11 15 def array_from_text_file(filename, dtype = 'float'):
Note: See TracChangeset
for help on using the changeset viewer.