Skip to content

Commit 9f7c9bf

Browse files
committed
Add pylint and black configs and apply black formatting
1 parent c698f03 commit 9f7c9bf

23 files changed

+4918
-2431
lines changed

docs/conf.py

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,28 @@
2020
import os
2121
import sys
2222

23-
sys.path.insert(0, os.path.abspath('..'))
23+
sys.path.insert(0, os.path.abspath(".."))
2424

2525
# For dependencies
2626
from unittest.mock import MagicMock
27+
28+
2729
class Mock(MagicMock):
2830
@classmethod
2931
def __getattr__(cls, name):
30-
return MagicMock()
31-
32-
MOCK_MODULES = ['numpy', 'matplotlib', 'matplotlib.pyplot', 'pandas', 'scipy',
33-
'sklearn', 'sklearn.preprocessing', 'mne']
32+
return MagicMock()
33+
34+
35+
MOCK_MODULES = [
36+
"numpy",
37+
"matplotlib",
38+
"matplotlib.pyplot",
39+
"pandas",
40+
"scipy",
41+
"sklearn",
42+
"sklearn.preprocessing",
43+
"mne",
44+
]
3445
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
3546

3647
# -- General configuration ------------------------------------------------
@@ -42,26 +53,26 @@ def __getattr__(cls, name):
4253
# Add any Sphinx extension module names here, as strings. They can be
4354
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4455
# ones.
45-
extensions = ['sphinx.ext.autodoc']
56+
extensions = ["sphinx.ext.autodoc"]
4657

4758
# Add any paths that contain templates here, relative to this directory.
48-
templates_path = ['_templates']
59+
templates_path = ["_templates"]
4960

5061
# The suffix(es) of source filenames.
5162
# You can specify multiple suffix as a list of string:
5263
#
5364
# source_suffix = ['.rst', '.md']
54-
source_suffix = '.rst'
65+
source_suffix = ".rst"
5566

5667
# The master toctree document.
57-
master_doc = 'index'
68+
master_doc = "index"
5869

5970
# General information about the project.
60-
project = 'wfdb'
61-
copyright = '2018, MIT Lab for Computational Physiology'
62-
author = 'MIT Lab for Computational Physiology'
71+
project = "wfdb"
72+
copyright = "2018, MIT Lab for Computational Physiology"
73+
author = "MIT Lab for Computational Physiology"
6374

64-
with open('../wfdb/version.py') as f:
75+
with open("../wfdb/version.py") as f:
6576
__version__ = f.read().split()[-1].strip("'")
6677
# The version info for the project you're documenting, acts as replacement for
6778
# |version| and |release|, also used in various other places throughout the
@@ -82,10 +93,10 @@ def __getattr__(cls, name):
8293
# List of patterns, relative to source directory, that match files and
8394
# directories to ignore when looking for source files.
8495
# This patterns also effect to html_static_path and html_extra_path
85-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
96+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
8697

8798
# The name of the Pygments (syntax highlighting) style to use.
88-
pygments_style = 'sphinx'
99+
pygments_style = "sphinx"
89100

90101
# If true, `todo` and `todoList` produce output, else they produce nothing.
91102
todo_include_todos = False
@@ -96,7 +107,7 @@ def __getattr__(cls, name):
96107
# The theme to use for HTML and HTML Help pages. See the documentation for
97108
# a list of builtin themes.
98109
#
99-
html_theme = 'classic'
110+
html_theme = "classic"
100111

101112
# Theme options are theme-specific and customize the look and feel of a theme
102113
# further. For a list of options available for each theme, see the
@@ -107,25 +118,25 @@ def __getattr__(cls, name):
107118
# Add any paths that contain custom static files (such as style sheets) here,
108119
# relative to this directory. They are copied after the builtin static files,
109120
# so a file named "default.css" will overwrite the builtin "default.css".
110-
html_static_path = ['_static']
121+
html_static_path = ["_static"]
111122

112123
# Custom sidebar templates, must be a dictionary that maps document names
113124
# to template names.
114125
#
115126
# This is required for the alabaster theme
116127
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
117128
html_sidebars = {
118-
'**': [
119-
'relations.html', # needs 'show_related': True theme option to display
120-
'searchbox.html',
129+
"**": [
130+
"relations.html", # needs 'show_related': True theme option to display
131+
"searchbox.html",
121132
]
122133
}
123134

124135

125136
# -- Options for HTMLHelp output ------------------------------------------
126137

127138
# Output file base name for HTML help builder.
128-
htmlhelp_basename = 'wfdbdoc'
139+
htmlhelp_basename = "wfdbdoc"
129140

130141

131142
# -- Options for LaTeX output ---------------------------------------------
@@ -134,15 +145,12 @@ def __getattr__(cls, name):
134145
# The paper size ('letterpaper' or 'a4paper').
135146
#
136147
# 'papersize': 'letterpaper',
137-
138148
# The font size ('10pt', '11pt' or '12pt').
139149
#
140150
# 'pointsize': '10pt',
141-
142151
# Additional stuff for the LaTeX preamble.
143152
#
144153
# 'preamble': '',
145-
146154
# Latex figure (float) alignment
147155
#
148156
# 'figure_align': 'htbp',
@@ -152,19 +160,15 @@ def __getattr__(cls, name):
152160
# (source start file, target name, title,
153161
# author, documentclass [howto, manual, or own class]).
154162
latex_documents = [
155-
(master_doc, 'wfdb.tex', 'wfdb Documentation',
156-
author, 'manual'),
163+
(master_doc, "wfdb.tex", "wfdb Documentation", author, "manual"),
157164
]
158165

159166

160167
# -- Options for manual page output ---------------------------------------
161168

162169
# One entry per manual page. List of tuples
163170
# (source start file, name, description, authors, manual section).
164-
man_pages = [
165-
(master_doc, 'wfdb', 'wfdb Documentation',
166-
[author], 1)
167-
]
171+
man_pages = [(master_doc, "wfdb", "wfdb Documentation", [author], 1)]
168172

169173

170174
# -- Options for Texinfo output -------------------------------------------
@@ -173,10 +177,13 @@ def __getattr__(cls, name):
173177
# (source start file, target name, title, author,
174178
# dir menu entry, description, category)
175179
texinfo_documents = [
176-
(master_doc, 'wfdb', 'wfdb Documentation',
177-
author, 'wfdb', 'One line description of project.',
178-
'Miscellaneous'),
180+
(
181+
master_doc,
182+
"wfdb",
183+
"wfdb Documentation",
184+
author,
185+
"wfdb",
186+
"One line description of project.",
187+
"Miscellaneous",
188+
),
179189
]
180-
181-
182-

0 commit comments

Comments
 (0)