Skip to content

Commit 396d235

Browse files
committed
Fix flake8 issues.
1 parent 7f6963b commit 396d235

File tree

3 files changed

+70
-54
lines changed

3 files changed

+70
-54
lines changed

cycler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ def __getitem__(self, key):
242242

243243
def __iter__(self):
244244
if self._right is None:
245-
for l in self._left:
246-
yield dict(l)
245+
for left in self._left:
246+
yield dict(left)
247247
else:
248248
for a, b in self._op(self._left, self._right):
249249
out = dict()

doc/source/conf.py

Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16-
import sys
17-
import os
18-
1916
# If extensions (or modules to document with autodoc) are in another directory,
2017
# add these directories to sys.path here. If the directory is relative to the
2118
# documentation root, use os.path.abspath to make it absolute, like shown here.
22-
#sys.path.insert(0, os.path.abspath('.'))
19+
# sys.path.insert(0, os.path.abspath('.'))
2320

2421
# -- General configuration ------------------------------------------------
2522

@@ -56,7 +53,7 @@
5653
source_suffix = '.rst'
5754

5855
# The encoding of source files.
59-
#source_encoding = 'utf-8-sig'
56+
# source_encoding = 'utf-8-sig'
6057

6158
# The master toctree document.
6259
master_doc = 'index'
@@ -76,13 +73,13 @@
7673

7774
# The language for content autogenerated by Sphinx. Refer to documentation
7875
# for a list of supported languages.
79-
#language = None
76+
# language = None
8077

8178
# There are two options for replacing |today|: either, you set today to some
8279
# non-false value, then it is used:
83-
#today = ''
80+
# today = ''
8481
# Else, today_fmt is used as the format for a strftime call.
85-
#today_fmt = '%B %d, %Y'
82+
# today_fmt = '%B %d, %Y'
8683

8784
# List of patterns, relative to source directory, that match files and
8885
# directories to ignore when looking for source files.
@@ -93,24 +90,24 @@
9390
default_role = 'obj'
9491

9592
# If true, '()' will be appended to :func: etc. cross-reference text.
96-
#add_function_parentheses = True
93+
# add_function_parentheses = True
9794

9895
# If true, the current module name will be prepended to all description
9996
# unit titles (such as .. function::).
100-
#add_module_names = True
97+
# add_module_names = True
10198

10299
# If true, sectionauthor and moduleauthor directives will be shown in the
103100
# output. They are ignored by default.
104-
#show_authors = False
101+
# show_authors = False
105102

106103
# The name of the Pygments (syntax highlighting) style to use.
107104
pygments_style = 'sphinx'
108105

109106
# A list of ignored prefixes for module index sorting.
110-
#modindex_common_prefix = []
107+
# modindex_common_prefix = []
111108

112109
# If true, keep warnings as "system message" paragraphs in the built documents.
113-
#keep_warnings = False
110+
# keep_warnings = False
114111

115112

116113
# -- Options for HTML output ----------------------------------------------
@@ -122,26 +119,26 @@
122119
# Theme options are theme-specific and customize the look and feel of a theme
123120
# further. For a list of options available for each theme, see the
124121
# documentation.
125-
#html_theme_options = {}
122+
# html_theme_options = {}
126123

127124
# Add any paths that contain custom themes here, relative to this directory.
128-
#html_theme_path = []
125+
# html_theme_path = []
129126

130127
# The name for this set of Sphinx documents. If None, it defaults to
131128
# "<project> v<release> documentation".
132-
#html_title = None
129+
# html_title = None
133130

134131
# A shorter title for the navigation bar. Default is the same as html_title.
135-
#html_short_title = None
132+
# html_short_title = None
136133

137134
# The name of an image file (relative to this directory) to place at the top
138135
# of the sidebar.
139-
#html_logo = None
136+
# html_logo = None
140137

141138
# The name of an image file (within the static path) to use as favicon of the
142139
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
143140
# pixels large.
144-
#html_favicon = None
141+
# html_favicon = None
145142

146143
# Add any paths that contain custom static files (such as style sheets) here,
147144
# relative to this directory. They are copied after the builtin static files,
@@ -151,48 +148,48 @@
151148
# Add any extra paths that contain custom files (such as robots.txt or
152149
# .htaccess) here, relative to this directory. These files are copied
153150
# directly to the root of the documentation.
154-
#html_extra_path = []
151+
# html_extra_path = []
155152

156153
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
157154
# using the given strftime format.
158-
#html_last_updated_fmt = '%b %d, %Y'
155+
# html_last_updated_fmt = '%b %d, %Y'
159156

160157
# If true, SmartyPants will be used to convert quotes and dashes to
161158
# typographically correct entities.
162-
#html_use_smartypants = True
159+
# html_use_smartypants = True
163160

164161
# Custom sidebar templates, maps document names to template names.
165-
#html_sidebars = {}
162+
# html_sidebars = {}
166163

167164
# Additional templates that should be rendered to pages, maps page names to
168165
# template names.
169-
#html_additional_pages = {}
166+
# html_additional_pages = {}
170167

171168
# If false, no module index is generated.
172-
#html_domain_indices = True
169+
# html_domain_indices = True
173170

174171
# If false, no index is generated.
175-
#html_use_index = True
172+
# html_use_index = True
176173

177174
# If true, the index is split into individual pages for each letter.
178-
#html_split_index = False
175+
# html_split_index = False
179176

180177
# If true, links to the reST sources are added to the pages.
181-
#html_show_sourcelink = True
178+
# html_show_sourcelink = True
182179

183180
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
184-
#html_show_sphinx = True
181+
# html_show_sphinx = True
185182

186183
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
187-
#html_show_copyright = True
184+
# html_show_copyright = True
188185

189186
# If true, an OpenSearch description file will be output, and all pages will
190187
# contain a <link> tag referring to it. The value of this option must be the
191188
# base URL from which the finished HTML is served.
192-
#html_use_opensearch = ''
189+
# html_use_opensearch = ''
193190

194191
# This is the file name suffix for HTML files (e.g. ".xhtml").
195-
#html_file_suffix = None
192+
# html_file_suffix = None
196193

197194
# Output file base name for HTML help builder.
198195
htmlhelp_basename = 'cyclerdoc'
@@ -201,14 +198,14 @@
201198
# -- Options for LaTeX output ---------------------------------------------
202199

203200
latex_elements = {
204-
# The paper size ('letterpaper' or 'a4paper').
205-
#'papersize': 'letterpaper',
201+
# The paper size ('letterpaper' or 'a4paper').
202+
# 'papersize': 'letterpaper',
206203

207-
# The font size ('10pt', '11pt' or '12pt').
208-
#'pointsize': '10pt',
204+
# The font size ('10pt', '11pt' or '12pt').
205+
# 'pointsize': '10pt',
209206

210-
# Additional stuff for the LaTeX preamble.
211-
#'preamble': '',
207+
# Additional stuff for the LaTeX preamble.
208+
# 'preamble': '',
212209
}
213210

214211
# Grouping the document tree into LaTeX files. List of tuples
@@ -221,23 +218,23 @@
221218

222219
# The name of an image file (relative to this directory) to place at the top of
223220
# the title page.
224-
#latex_logo = None
221+
# latex_logo = None
225222

226223
# For "manual" documents, if this is true, then toplevel headings are parts,
227224
# not chapters.
228-
#latex_use_parts = False
225+
# latex_use_parts = False
229226

230227
# If true, show page references after internal links.
231-
#latex_show_pagerefs = False
228+
# latex_show_pagerefs = False
232229

233230
# If true, show URL addresses after external links.
234-
#latex_show_urls = False
231+
# latex_show_urls = False
235232

236233
# Documents to append as an appendix to all manuals.
237-
#latex_appendices = []
234+
# latex_appendices = []
238235

239236
# If false, no module index is generated.
240-
#latex_domain_indices = True
237+
# latex_domain_indices = True
241238

242239

243240
# -- Options for manual page output ---------------------------------------
@@ -250,7 +247,7 @@
250247
]
251248

252249
# If true, show URL addresses after external links.
253-
#man_show_urls = False
250+
# man_show_urls = False
254251

255252

256253
# -- Options for Texinfo output -------------------------------------------
@@ -265,19 +262,19 @@
265262
]
266263

267264
# Documents to append as an appendix to all manuals.
268-
#texinfo_appendices = []
265+
# texinfo_appendices = []
269266

270267
# If false, no module index is generated.
271-
#texinfo_domain_indices = True
268+
# texinfo_domain_indices = True
272269

273270
# How to display URL addresses: 'footnote', 'no', or 'inline'.
274-
#texinfo_show_urls = 'footnote'
271+
# texinfo_show_urls = 'footnote'
275272

276273
# If true, do not generate a @detailmenu in the "Top" node's menu.
277-
#texinfo_no_detailmenu = False
274+
# texinfo_no_detailmenu = False
278275

279276
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
280277
'matplotlb': ('https://matplotlib.org', None)}
281278

282-
################# numpydoc config ####################
279+
# ################ numpydoc config ####################
283280
numpydoc_show_class_members = False

test_cycler.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,26 @@ def test_repr():
178178
_repr_tester_helper('__repr__', c + c2, c_sum_rpr)
179179
_repr_tester_helper('__repr__', c * c2, c_prod_rpr)
180180

181-
sum_html = "<table><th>'3rd'</th><th>'c'</th><tr><td>0</td><td>'r'</td></tr><tr><td>1</td><td>'g'</td></tr><tr><td>2</td><td>'b'</td></tr></table>"
182-
prod_html = "<table><th>'3rd'</th><th>'c'</th><tr><td>0</td><td>'r'</td></tr><tr><td>1</td><td>'r'</td></tr><tr><td>2</td><td>'r'</td></tr><tr><td>0</td><td>'g'</td></tr><tr><td>1</td><td>'g'</td></tr><tr><td>2</td><td>'g'</td></tr><tr><td>0</td><td>'b'</td></tr><tr><td>1</td><td>'b'</td></tr><tr><td>2</td><td>'b'</td></tr></table>"
181+
sum_html = (
182+
"<table>"
183+
"<th>'3rd'</th><th>'c'</th>"
184+
"<tr><td>0</td><td>'r'</td></tr>"
185+
"<tr><td>1</td><td>'g'</td></tr>"
186+
"<tr><td>2</td><td>'b'</td></tr>"
187+
"</table>")
188+
prod_html = (
189+
"<table>"
190+
"<th>'3rd'</th><th>'c'</th>"
191+
"<tr><td>0</td><td>'r'</td></tr>"
192+
"<tr><td>1</td><td>'r'</td></tr>"
193+
"<tr><td>2</td><td>'r'</td></tr>"
194+
"<tr><td>0</td><td>'g'</td></tr>"
195+
"<tr><td>1</td><td>'g'</td></tr>"
196+
"<tr><td>2</td><td>'g'</td></tr>"
197+
"<tr><td>0</td><td>'b'</td></tr>"
198+
"<tr><td>1</td><td>'b'</td></tr>"
199+
"<tr><td>2</td><td>'b'</td></tr>"
200+
"</table>")
183201

184202
_repr_tester_helper('_repr_html_', c + c2, sum_html)
185203
_repr_tester_helper('_repr_html_', c * c2, prod_html)
@@ -233,6 +251,7 @@ def test_copying():
233251
assert c == (cycler(c=[1, 2, 3], lw=['r', 'g', 'b']) *
234252
cycler('foo', [['y', 'g', 'blue'], ['b', 'k']]))
235253
assert c3 == cycler('foo', [['y', 'g', 'blue'], ['b', 'k']])
254+
assert c4 == cycler('bar', [['y', 'g', 'blue'], ['b', 'k']])
236255

237256

238257
def test_keychange():

0 commit comments

Comments
 (0)