22
22
BASELINE_DIR = 'baseline_images/test_viz'
23
23
24
24
25
- class Test__fit_line (object ):
25
+ class Test_fit_line (object ):
26
26
def setup (self ):
27
27
self .data = numpy .array ([
28
28
2.00 , 4.0 , 4.62 , 5.00 , 5.00 , 5.50 , 5.57 , 5.66 ,
@@ -71,56 +71,56 @@ def setup(self):
71
71
def test_xlinear_ylinear (self ):
72
72
scales = {'fitlogs' : None , 'fitprobs' : None }
73
73
x , y = self .zscores , self .data
74
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
74
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
75
75
nptest .assert_array_almost_equal (y_ , self .known_y_linlin )
76
76
assert isinstance (res , numpy .ndarray )
77
77
78
78
def test_xlinear_ylog (self ):
79
79
scales = {'fitlogs' : 'y' , 'fitprobs' : None }
80
80
x , y = self .zscores , self .data
81
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
81
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
82
82
nptest .assert_array_almost_equal (y_ , self .known_y_linlog )
83
83
assert isinstance (res , numpy .ndarray )
84
84
85
85
def test_xlinear_yprob (self ):
86
86
scales = {'fitlogs' : None , 'fitprobs' : 'y' }
87
87
x , y = self .data , self .probs
88
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
88
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
89
89
nptest .assert_array_almost_equal (y_ , self .known_y_linprob )
90
90
assert isinstance (res , numpy .ndarray )
91
91
92
92
def test_xlog_ylinear (self ):
93
93
scales = {'fitlogs' : 'x' , 'fitprobs' : None }
94
94
x , y = self .data , self .zscores
95
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
95
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
96
96
nptest .assert_array_almost_equal (y_ , self .known_y_loglin )
97
97
assert isinstance (res , numpy .ndarray )
98
98
99
99
def test_xlog_ylog (self ):
100
100
scales = {'fitlogs' : 'both' , 'fitprobs' : None }
101
101
x , y = self .data , self .y
102
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
102
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
103
103
nptest .assert_array_almost_equal (y_ , self .known_y_loglog )
104
104
assert isinstance (res , numpy .ndarray )
105
105
106
106
def test_xlog_yprob (self ):
107
107
scales = {'fitlogs' : 'x' , 'fitprobs' : 'y' }
108
108
x , y = self .data , self .probs
109
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
109
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
110
110
nptest .assert_array_almost_equal (y_ , self .known_y_logprob )
111
111
assert isinstance (res , numpy .ndarray )
112
112
113
113
def test_xprob_ylinear (self ):
114
114
scales = {'fitlogs' : None , 'fitprobs' : 'x' }
115
115
x , y = self .probs , self .data
116
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
116
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
117
117
nptest .assert_array_almost_equal (y_ , self .known_y_problin )
118
118
assert isinstance (res , numpy .ndarray )
119
119
120
120
def test_xprob_ylog (self ):
121
121
scales = {'fitlogs' : 'y' , 'fitprobs' : 'x' }
122
122
x , y = self .probs , self .data
123
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
123
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
124
124
nptest .assert_array_almost_equal (y_ , self .known_y_problog )
125
125
assert isinstance (res , numpy .ndarray )
126
126
@@ -139,23 +139,23 @@ def test_xprob_yprob(self):
139
139
140
140
scales = {'fitlogs' : None , 'fitprobs' : 'both' }
141
141
x , y = self .probs , p2 ,
142
- x_ , y_ , res = viz ._fit_line (x , y , ** scales )
142
+ x_ , y_ , res = viz .fit_line (x , y , ** scales )
143
143
nptest .assert_array_almost_equal (y_ , self .known_y_probprob )
144
144
assert isinstance (res , numpy .ndarray )
145
145
146
146
def test_bad_fitlogs (self ):
147
147
with pytest .raises (ValueError ):
148
148
x , y = self .zscores , self .data
149
- x_ , y_ , res = viz ._fit_line (x , y , fitlogs = 'junk' )
149
+ x_ , y_ , res = viz .fit_line (x , y , fitlogs = 'junk' )
150
150
151
151
def test_bad_fitprobs (self ):
152
152
with pytest .raises (ValueError ):
153
153
x , y = self .zscores , self .data
154
- x_ , y_ , res = viz ._fit_line (x , y , fitprobs = 'junk' )
154
+ x_ , y_ , res = viz .fit_line (x , y , fitprobs = 'junk' )
155
155
156
156
def test_custom_xhat (self ):
157
157
x , y = self .zscores , self .data
158
- x_ , y_ , res = viz ._fit_line (x , y , xhat = self .custom_xhat )
158
+ x_ , y_ , res = viz .fit_line (x , y , xhat = self .custom_xhat )
159
159
nptest .assert_array_almost_equal (y_ , self .known_custom_yhat )
160
160
161
161
0 commit comments