@@ -111,6 +111,24 @@ def test_formatstrformatter():
111
111
tmp_form = mticker .StrMethodFormatter ('{x:05d}' )
112
112
nose .tools .assert_equal ('00002' , tmp_form (2 ))
113
113
114
+ @cleanup
115
+ def test_set_params ():
116
+ loc = mticker .LogLocator (numticks = 2 )
117
+
118
+ assert_raises (ValueError , loc .tick_values , 0 , 1000 )
119
+ #this should return number of ticks as 5
120
+ test_value = np .array ([ 1.0000000e-10 , 1.0000000e-03 , 1.0000000e+04 , 1.0000000e+11 ,
121
+ 1.0000000e+18 ])
122
+ assert_almost_equal (loc .tick_values (0.001 , 1.1e5 ), test_value )
123
+ #after the set_params(numticks=8), it should have 7 extra which should have 7 extra
124
+ #numticks. Also it won't casue to thrown the exception for bugs # #3658
125
+ loc .set_params (numticks = 8 )
126
+ test_value = np .array ([ 1.0000000e-04 , 1.0000000e-03 , 1.0000000e-02 , 1.0000000e-01 ,
127
+ 1.0000000e+00 , 1.0000000e+01 , 1.0000000e+02 , 1.0000000e+03 ,
128
+ 1.0000000e+04 , 1.0000000e+05 , 1.0000000e+06 , 1.0000000e+07 ])
129
+ assert_almost_equal (loc .tick_values (0.001 , 1.1e5 ), test_value )
130
+
131
+
114
132
115
133
if __name__ == '__main__' :
116
134
import nose
0 commit comments