Changeset 689106e for python/tests/test_mathutils.py
- Timestamp:
- Apr 18, 2016, 11:24:47 PM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 6db7600
- Parents:
- 1c6fe64
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_mathutils.py
r1c6fe64 r689106e 13 13 unwrap2pi(int(23)) 14 14 unwrap2pi(float(23.)) 15 unwrap2pi( long(23.))15 unwrap2pi(int(23.)) 16 16 unwrap2pi(arange(10)) 17 17 unwrap2pi(arange(10).astype("int")) … … 28 28 29 29 try: 30 print unwrap2pi(["23.","24.",25.])31 except Exception ,e:30 print (unwrap2pi(["23.","24.",25.])) 31 except Exception as e: 32 32 pass 33 33 … … 54 54 55 55 def test_freqtomidi(self): 56 a = array( range(-20, 50000, 100) + [ -1e32, 1e32 ])56 a = array(list(range(-20, 50000, 100)) + [ -1e32, 1e32 ]) 57 57 b = freqtomidi(a) 58 58 #print zip(a, b) … … 62 62 63 63 def test_miditofreq(self): 64 a = range(-30, 200) + [-100000, 10000]64 a = list(range(-30, 200)) + [-100000, 10000] 65 65 b = miditofreq(a) 66 66 #print zip(a, b) … … 70 70 71 71 def test_miditobin(self): 72 a = range(-30, 200) + [-100000, 10000]72 a = list(range(-30, 200)) + [-100000, 10000] 73 73 b = [ bintomidi(x, 44100, 512) for x in a ] 74 74 #print zip(a, b) … … 78 78 79 79 def test_bintomidi(self): 80 a = range(-100, 512)80 a = list(range(-100, 512)) 81 81 b = [ bintomidi(x, 44100, 512) for x in a ] 82 82 #print zip(a, b) … … 86 86 87 87 def test_freqtobin(self): 88 a = range(-20, 50000, 100) + [ -1e32, 1e32 ]88 a = list(range(-20, 50000, 100)) + [ -1e32, 1e32 ] 89 89 b = [ freqtobin(x, 44100, 512) for x in a ] 90 90 #print zip(a, b) … … 94 94 95 95 def test_bintofreq(self): 96 a = range(-20, 148)96 a = list(range(-20, 148)) 97 97 b = [ bintofreq(x, 44100, 512) for x in a ] 98 98 #print zip(a, b)
Note: See TracChangeset
for help on using the changeset viewer.