Skip to content

Commit 45fe2a1

Browse files
PGijsbersmfeurer
authored andcommitted
[WIP] Fix624 pep8 (#625)
* PEP8. No unused import. # always follows by space. * PEP8 * Edit a blank line back in for file formatting. * PEP8. Fix grammar. * PEP8 * PEP8. * PEP8 * Refactor. * PEP8, small refactor. * OpenMLStudy available through import * * PEP8. * PEP8. * PEP8. Removed Py2 support. * PEP8. * PEP8. Minor refactor. * PEP8. Refactor/bugfix __eq__ * PEP8. task type are input for list_tasks anyway, so the enum should be exposed. * PEP8. * undo linebreaks * Update for updated error message. * Update for updated error message. * Undo refactor. * Redo refactor. * Fix syntax error due to online merging * Fix merge error due to online merging * Fix bug due to online merge error * Change flake scope and arguments. * Final PEP8 changes. * PEP8 for several test files * PEP8. * PEP8. * PEP8. Removed import 'unused' import statements. Have to watch unit tests. * Fix bug regarding not existing argument * PEP8. * Flake8 ignore directive.
1 parent a2a4ade commit 45fe2a1

42 files changed

Lines changed: 637 additions & 478 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ci_scripts/flake8_diff.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ check_files() {
140140
if [ -n "$files" ]; then
141141
# Conservative approach: diff without context (--unified=0) so that code
142142
# that was not changed does not create failures
143-
git diff --no-ext-diff --unified=0 $COMMIT_RANGE -- $files | flake8 --ignore E402 --diff --show-source $options
143+
# git diff --no-ext-diff --unified=0 $COMMIT_RANGE -- $files | flake8 --ignore E402 --diff --show-source $options
144+
flake8 --ignore E402,W503 --show-source --max-line-length 100 $options
144145
fi
145146
}
146147

doc/conf.py

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import os
1616
import sys
1717
import sphinx_bootstrap_theme
18-
from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey
1918
import openml
2019

2120

@@ -27,19 +26,19 @@
2726
# If extensions (or modules to document with autodoc) are in another directory,
2827
# add these directories to sys.path here. If the directory is relative to the
2928
# documentation root, use os.path.abspath to make it absolute, like shown here.
30-
#sys.path.insert(0, os.path.abspath('.')# )
29+
# sys.path.insert(0, os.path.abspath('.')# )
3130

3231
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
3332
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
3433

3534
# -- General configuration ------------------------------------------------
3635

3736
# If your documentation needs a minimal Sphinx version, state it here.
38-
#needs_sphinx = '1.0'
37+
# needs_sphinx = '1.0'
3938

40-
# Add any Sphinx extension module names here, as strings. They can be
41-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
42-
# ones.
39+
# Add any Sphinx extension module names here, as strings. They can be
40+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
41+
# ones.
4342
extensions = [
4443
'sphinx.ext.autodoc',
4544
'sphinx.ext.autosummary',
@@ -64,7 +63,7 @@
6463
source_suffix = '.rst'
6564

6665
# The encoding of source files.
67-
#source_encoding = 'utf-8-sig'
66+
# source_encoding = 'utf-8-sig'
6867

6968
# The master toctree document.
7069
master_doc = 'index'
@@ -87,41 +86,41 @@
8786

8887
# The language for content autogenerated by Sphinx. Refer to documentation
8988
# for a list of supported languages.
90-
#language = None
89+
# language = None
9190

9291
# There are two options for replacing |today|: either, you set today to some
9392
# non-false value, then it is used:
94-
#today = ''
93+
# today = ''
9594
# Else, today_fmt is used as the format for a strftime call.
96-
#today_fmt = '%B %d, %Y'
95+
# today_fmt = '%B %d, %Y'
9796

9897
# List of patterns, relative to source directory, that match files and
9998
# directories to ignore when looking for source files.
10099
exclude_patterns = ['_build', '_templates', '_static']
101100

102101
# The reST default role (used for this markup: `text`) to use for all
103102
# documents.
104-
#default_role = None
103+
# default_role = None
105104

106105
# If true, '()' will be appended to :func: etc. cross-reference text.
107-
#add_function_parentheses = True
106+
# add_function_parentheses = True
108107

109108
# If true, the current module name will be prepended to all description
110109
# unit titles (such as .. function::).
111-
#add_module_names = True
110+
# add_module_names = True
112111

113112
# If true, sectionauthor and moduleauthor directives will be shown in the
114113
# output. They are ignored by default.
115-
#show_authors = False
114+
# show_authors = False
116115

117116
# The name of the Pygments (syntax highlighting) style to use.
118117
pygments_style = 'sphinx'
119118

120119
# A list of ignored prefixes for module index sorting.
121-
#modindex_common_prefix = []
120+
# modindex_common_prefix = []
122121

123122
# If true, keep warnings as "system message" paragraphs in the built documents.
124-
#keep_warnings = False
123+
# keep_warnings = False
125124

126125

127126
# -- Options for HTML output ----------------------------------------------
@@ -135,7 +134,7 @@
135134
'navbar_title': "OpenML",
136135

137136
# Tab name for entire site. (Default: "Site")
138-
#'navbar_site_name': "Site",
137+
# 'navbar_site_name': "Site",
139138

140139
# A list of tuples containting pages to link to. The value should
141140
# be in the form [(name, page), ..]
@@ -198,19 +197,19 @@
198197

199198
# The name for this set of Sphinx documents. If None, it defaults to
200199
# "<project> v<release> documentation".
201-
#html_title = None
200+
# html_title = None
202201

203202
# A shorter title for the navigation bar. Default is the same as html_title.
204-
#html_short_title = None
203+
# html_short_title = None
205204

206205
# The name of an image file (relative to this directory) to place at the top
207206
# of the sidebar.
208-
#html_logo = None
207+
# html_logo = None
209208

210209
# The name of an image file (within the static path) to use as favicon of the
211210
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
212211
# pixels large.
213-
#html_favicon = None
212+
# html_favicon = None
214213

215214
# Add any paths that contain custom static files (such as style sheets) here,
216215
# relative to this directory. They are copied after the builtin static files,
@@ -220,48 +219,48 @@
220219
# Add any extra paths that contain custom files (such as robots.txt or
221220
# .htaccess) here, relative to this directory. These files are copied
222221
# directly to the root of the documentation.
223-
#html_extra_path = []
222+
# html_extra_path = []
224223

225224
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
226225
# using the given strftime format.
227-
#html_last_updated_fmt = '%b %d, %Y'
226+
# html_last_updated_fmt = '%b %d, %Y'
228227

229228
# If true, SmartyPants will be used to convert quotes and dashes to
230229
# typographically correct entities.
231-
#html_use_smartypants = True
230+
# html_use_smartypants = True
232231

233232
# Custom sidebar templates, maps document names to template names.
234233
html_sidebars = {'**': ['localtoc.html']}
235234

236235
# Additional templates that should be rendered to pages, maps page names to
237236
# template names.
238-
#html_additional_pages = {}
237+
# html_additional_pages = {}
239238

240239
# If false, no module index is generated.
241-
#html_domain_indices = True
240+
# html_domain_indices = True
242241

243242
# If false, no index is generated.
244-
#html_use_index = True
243+
# html_use_index = True
245244

246245
# If true, the index is split into individual pages for each letter.
247-
#html_split_index = False
246+
# html_split_index = False
248247

249248
# If true, links to the reST sources are added to the pages.
250-
#html_show_sourcelink = True
249+
# html_show_sourcelink = True
251250

252251
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
253-
#html_show_sphinx = True
252+
# html_show_sphinx = True
254253

255254
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
256-
#html_show_copyright = True
255+
# html_show_copyright = True
257256

258257
# If true, an OpenSearch description file will be output, and all pages will
259258
# contain a <link> tag referring to it. The value of this option must be the
260259
# base URL from which the finished HTML is served.
261-
#html_use_opensearch = ''
260+
# html_use_opensearch = ''
262261

263262
# This is the file name suffix for HTML files (e.g. ".xhtml").
264-
#html_file_suffix = None
263+
# html_file_suffix = None
265264

266265
# Output file base name for HTML help builder.
267266
htmlhelp_basename = 'OpenMLdoc'
@@ -271,13 +270,13 @@
271270

272271
latex_elements = {
273272
# The paper size ('letterpaper' or 'a4paper').
274-
#'papersize': 'letterpaper',
273+
# 'papersize': 'letterpaper',
275274

276275
# The font size ('10pt', '11pt' or '12pt').
277-
#'pointsize': '10pt',
276+
# 'pointsize': '10pt',
278277

279278
# Additional stuff for the LaTeX preamble.
280-
#'preamble': '',
279+
# 'preamble': '',
281280
}
282281

283282
# Grouping the document tree into LaTeX files. List of tuples
@@ -288,23 +287,23 @@
288287

289288
# The name of an image file (relative to this directory) to place at the top of
290289
# the title page.
291-
#latex_logo = None
290+
# latex_logo = None
292291

293292
# For "manual" documents, if this is true, then toplevel headings are parts,
294293
# not chapters.
295-
#latex_use_parts = False
294+
# latex_use_parts = False
296295

297296
# If true, show page references after internal links.
298-
#latex_show_pagerefs = False
297+
# latex_show_pagerefs = False
299298

300299
# If true, show URL addresses after external links.
301-
#latex_show_urls = False
300+
# latex_show_urls = False
302301

303302
# Documents to append as an appendix to all manuals.
304-
#latex_appendices = []
303+
# latex_appendices = []
305304

306305
# If false, no module index is generated.
307-
#latex_domain_indices = True
306+
# latex_domain_indices = True
308307

309308

310309
# -- Options for manual page output ---------------------------------------
@@ -317,7 +316,7 @@
317316
]
318317

319318
# If true, show URL addresses after external links.
320-
#man_show_urls = False
319+
# man_show_urls = False
321320

322321

323322
# -- Options for Texinfo output -------------------------------------------
@@ -332,19 +331,20 @@
332331
]
333332

334333
# Documents to append as an appendix to all manuals.
335-
#texinfo_appendices = []
334+
# texinfo_appendices = []
336335

337336
# If false, no module index is generated.
338-
#texinfo_domain_indices = True
337+
# texinfo_domain_indices = True
339338

340339
# How to display URL addresses: 'footnote', 'no', or 'inline'.
341-
#texinfo_show_urls = 'footnote'
340+
# texinfo_show_urls = 'footnote'
342341

343342
# If true, do not generate a @detailmenu in the "Top" node's menu.
344-
#texinfo_no_detailmenu = False
343+
# texinfo_no_detailmenu = False
345344

346-
# prefix each section label with the name of the document it is in, in order to avoid
347-
# ambiguity when there are multiple same section labels in different documents.
345+
# prefix each section label with the name of the document it is in,
346+
# in order to avoid ambiguity when there are multiple same section
347+
# labels in different documents.
348348
autosectionlabel_prefix_document = True
349349
# Sphinx-gallery configuration.
350350
sphinx_gallery_conf = {
@@ -356,5 +356,5 @@
356356
'gallery_dirs': 'examples',
357357
# compile execute examples in the examples dir
358358
'filename_pattern': '.*example.py$|.*tutorial.py$',
359-
#TODO: fix back/forward references for the examples.
359+
# TODO: fix back/forward references for the examples.
360360
}

examples/datasets_tutorial.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454

5555
############################################################################
5656
# Get the actual data.
57-
#
58-
# Returned as numpy array, with meta-info (e.g. target feature, feature names,...)
57+
#
58+
# Returned as numpy array, with meta-info
59+
# (e.g. target feature, feature names, ...)
5960
X, y, attribute_names = dataset.get_data(
6061
target=dataset.default_target_attribute,
6162
return_attribute_names=True,
@@ -77,4 +78,4 @@
7778
hist_kwds={'bins': 20},
7879
alpha=.8,
7980
cmap='plasma'
80-
)
81+
)

examples/flows_and_runs_tutorial.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"""
77

88
import openml
9-
import pandas as pd
10-
import seaborn as sns
119
from pprint import pprint
1210
from sklearn import ensemble, neighbors, preprocessing, pipeline, tree
1311

@@ -60,7 +58,7 @@
6058
############################################################################
6159
# Share the run on the OpenML server
6260
#
63-
# So far the run is only available locally. By calling the publish function, the run is send to the OpenML server:
61+
# So far the run is only available locally. By calling the publish function, the run is sent to the OpenML server:
6462

6563
myrun = run.publish()
6664
# For this tutorial, our configuration publishes to the test server

openml/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* analyze experiments (uploaded by you and other collaborators) and conduct
1010
meta studies
1111
12-
In particular, this module implemts a python interface for the
12+
In particular, this module implements a python interface for the
1313
`OpenML REST API <https://www.openml.org/guide#!rest_services>`_
1414
(`REST on wikipedia
1515
<http://en.wikipedia.org/wiki/Representational_state_transfer>`_).
@@ -22,15 +22,15 @@
2222
from . import runs
2323
from . import flows
2424
from . import setups
25-
from . import study
2625
from . import evaluations
27-
from . import utils
26+
2827
from .runs import OpenMLRun
2928
from .tasks import OpenMLTask, OpenMLSplit
3029
from .flows import OpenMLFlow
3130
from .evaluations import OpenMLEvaluation
31+
from .study import OpenMLStudy
3232

33-
from .__version__ import __version__
33+
from .__version__ import __version__ # noqa: F401
3434

3535

3636
def populate_cache(task_ids=None, dataset_ids=None, flow_ids=None,
@@ -71,5 +71,5 @@ def populate_cache(task_ids=None, dataset_ids=None, flow_ids=None,
7171

7272
__all__ = ['OpenMLDataset', 'OpenMLDataFeature', 'OpenMLRun',
7373
'OpenMLSplit', 'OpenMLEvaluation', 'OpenMLSetup',
74-
'OpenMLTask', 'OpenMLFlow', 'datasets', 'evaluations',
75-
'config', 'runs', 'flows', 'tasks', 'setups']
74+
'OpenMLTask', 'OpenMLFlow', 'OpenMLStudy', 'datasets',
75+
'evaluations', 'config', 'runs', 'flows', 'tasks', 'setups']

0 commit comments

Comments
 (0)