File tree 4 files changed +13
-14
lines changed
4 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 2
2
import sys , os
3
3
4
4
def pytest_sessionstart (session ):
5
- print 'testing...'
6
- print os .path .realpath (__file__ )
7
5
sys .path .append (os .path .dirname (__file__ ))
Original file line number Diff line number Diff line change 1
- import os
2
- os .chdir ('..' )
1
+ import os , sys
3
2
4
3
import numpy as np
5
4
9
8
from signals import Trajectory
10
9
from PRFstats .interface import L2ROCs
11
10
11
+ os .chdir ('..' )
12
+ sys .path .append (os .path .dirname (__file__ ))
12
13
13
- # test_TS #
14
14
def prepare_TS ():
15
15
sig = TimeSeries (
16
16
'unit_tests/data/40-clarinet.txt' ,
@@ -21,7 +21,6 @@ def prepare_TS():
21
21
np .save ('unit_tests/ref/TS.npy' , sig .windows )
22
22
23
23
24
- # test_Traj #
25
24
def prepare_Traj ():
26
25
sig = Trajectory (
27
26
'unit_tests/data/ellipse-test.txt' ,
@@ -31,8 +30,7 @@ def prepare_Traj():
31
30
)
32
31
np .save ('unit_tests/ref/Traj.npy' , sig .windows )
33
32
34
- # test_L2MeanPRF_ROCs #
35
- def prepare_L2MeanPRF_ROCs ():
33
+ def prepare_L2ROCs ():
36
34
filt_params = dfp .copy ()
37
35
ts1 = TimeSeries (
38
36
'unit_tests/data/40-clarinet.txt' ,
@@ -59,15 +57,16 @@ def prepare_L2MeanPRF_ROCs():
59
57
out = L2ROCs (
60
58
traj1 , traj2 ,
61
59
'clarinet' , 'viol' ,
62
- 'unit_tests/output/L2MeanPRF .png' ,
60
+ 'unit_tests/output/L2ROCs .png' ,
63
61
filt_params ,
64
62
k = (0 , 5.01 , .1 ),
65
63
load_saved_filts = False ,
66
64
quiet = True
67
65
)
68
- np .save ('unit_tests/ref/L2MeanPRF_ROC .npy' , out )
66
+ np .save ('unit_tests/ref/L2ROCs .npy' , out )
69
67
70
68
71
69
if __name__ == '__main__' :
72
- # prepare_L2MeanPRF_ROCs ()
70
+ prepare_L2ROCs ()
73
71
pass
72
+
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def test_Traj():
32
32
assert np .array_equal (sig .windows , np .load ('unit_tests/ref/Traj.npy' ))
33
33
34
34
35
- def test_L2MeanPRF_ROCs ():
35
+ def test_L2ROCs ():
36
36
filt_params = dfp .copy ()
37
37
ts1 = TimeSeries (
38
38
'unit_tests/data/40-clarinet.txt' ,
@@ -56,7 +56,7 @@ def test_L2MeanPRF_ROCs():
56
56
'num_divisions' : 5 ,
57
57
'ds_rate' : 120
58
58
})
59
- out = L2ROCs (
59
+ result = L2ROCs (
60
60
traj1 , traj2 ,
61
61
'clarinet' , 'viol' ,
62
62
'unit_tests/output/L2MeanPRF.png' ,
@@ -65,4 +65,6 @@ def test_L2MeanPRF_ROCs():
65
65
load_saved_filts = False ,
66
66
quiet = True
67
67
)
68
- assert np .array_equal (out , np .load ('unit_tests/ref/L2MeanPRF_ROC.npy' ))
68
+
69
+ ref = np .load ('unit_tests/ref/L2ROCs.npy' )
70
+ assert np .array_equal (result , ref )
You can’t perform that action at this time.
0 commit comments