Skip to content

Commit 4f25d41

Browse files
ryanbeltleeonadoh
authored andcommitted
PEP8 style check0
1 parent fc207d4 commit 4f25d41

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

lib/matplotlib/tests/test_ticker.py

+30-30
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,24 @@ def test_LogLocator():
6666

6767

6868
def test_LogLocator_set_params():
69-
"""
70-
Create log locator with default value, base=10.0, subs=[1.0], numdecs=4, numticks=15
71-
and change it to something else.
72-
See if change was successful.
73-
Should not exception.
69+
"""
70+
Create log locator with default value, base=10.0, subs=[1.0], numdecs=4,
71+
numticks=15 and change it to something else.
72+
See if change was successful.
73+
Should not exception.
7474
"""
7575
loc = mticker.LogLocator()
76-
loc.set_params(numticks = 8, numdecs = 8, subs = [2.0], base = 8)
76+
loc.set_params(numticks=8, numdecs=8, subs=[2.0], base=8)
7777
nose.tools.assert_equal(loc.numticks, 8)
7878
nose.tools.assert_equal(loc.numdecs, 8)
7979
nose.tools.assert_equal(loc.base, 8)
8080
nose.tools.assert_equal(loc.subs, [2.0])
8181

8282

8383
def test_NullLocator_set_params():
84-
"""
85-
Create null locator, and attempt to call set_params() on it.
86-
Should not exception, and should raise a warning.
84+
"""
85+
Create null locator, and attempt to call set_params() on it.
86+
Should not exception, and should raise a warning.
8787
"""
8888
loc = mticker.NullLocator()
8989
with warnings.catch_warnings(True) as w:
@@ -92,49 +92,49 @@ def test_NullLocator_set_params():
9292

9393

9494
def test_MultipleLocator_set_params():
95-
"""
95+
"""
9696
Create multiple locator with 0.7 base, and change it to something else.
97-
See if change was successful.
98-
Should not exception.
97+
See if change was successful.
98+
Should not exception.
9999
"""
100-
mult = mticker.MultipleLocator(base = 0.7)
101-
mult.set_params(base = 1.7)
100+
mult = mticker.MultipleLocator(base=0.7)
101+
mult.set_params(base=1.7)
102102
nose.tools.assert_equal(mult.base, 1.7)
103103

104104

105105
def test_FixedLocator_set_params():
106-
"""
106+
"""
107107
Create fixed locator with 5 nbins, and change it to something else.
108-
See if change was successful.
109-
Should not exception.
108+
See if change was successful.
109+
Should not exception.
110110
"""
111-
fixed = mticker.FixedLocator(range (0,24),nbins=5)
112-
fixed.set_params(nbins = 7)
111+
fixed = mticker.FixedLocator(range(0, 24), nbins=5)
112+
fixed.set_params(nbins=7)
113113
nose.tools.assert_equal(fixed.nbins, 7)
114114

115115

116116
def test_IndexLocator_set_params():
117-
"""
118-
Create index locator with 3 base, 4 offset. and change it to something else.
119-
See if change was successful.
120-
Should not exception.
121117
"""
122-
index = mticker.IndexLocator(base = 3, offset = 4)
123-
index.set_params(base = 7, offset = 7)
118+
Create index locator with 3 base, 4 offset. and change it to something
119+
else. See if change was successful.
120+
Should not exception.
121+
"""
122+
index = mticker.IndexLocator(base=3, offset=4)
123+
index.set_params(base=7, offset=7)
124124
nose.tools.assert_equal(index.base, 7)
125125
nose.tools.assert_equal(index.offset, 7)
126126

127127

128128
def test_SymmetricalLogLocator_set_params():
129-
"""
129+
"""
130130
Create symmetrical log locator with default subs =[1.0] numticks = 15,
131131
and change it to something else.
132-
See if change was successful.
133-
Should not exception.
132+
See if change was successful.
133+
Should not exception.
134134
"""
135-
#since we only test for the params change. I will pass empty transform
135+
# since we only test for the params change. I will pass empty transform
136136
sym = mticker.SymmetricalLogLocator(None)
137-
sym.set_params(subs = [2.0], numticks = 8)
137+
sym.set_params(subs=[2.0], numticks=8)
138138
nose.tools.assert_equal(sym._subs, [2.0])
139139
nose.tools.assert_equal(sym.numticks, 8)
140140

lib/matplotlib/ticker.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,8 @@ def tick_values(self, vmin, vmax):
956956
raise NotImplementedError('Derived must override')
957957

958958
def set_params(self, **kwargs):
959-
warnings.warn("'set_params()' not defined for locator of type " + str(type(self)))
959+
warnings.warn("'set_params()' not defined for locator of type " +
960+
str(type(self)))
960961

961962
def __call__(self):
962963
"""Return the locations of the ticks"""

0 commit comments

Comments
 (0)