|
19 | 19 | # If extensions (or modules to document with autodoc) are in another directory,
|
20 | 20 | # add these directories to sys.path here. If the directory is relative to the
|
21 | 21 | # documentation root, use os.path.abspath to make it absolute, like shown here.
|
22 |
| -sys.path.insert(0, os.path.abspath('sphinxext')) |
| 22 | +sys.path.insert(0, os.path.abspath("sphinxext")) |
23 | 23 | from github_link import make_linkcode_resolve
|
24 | 24 | import sphinx_gallery
|
25 | 25 |
|
|
32 | 32 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
33 | 33 | # ones.
|
34 | 34 | extensions = [
|
35 |
| - 'sphinx.ext.autodoc', |
36 |
| - 'sphinx.ext.autosummary', |
37 |
| - 'sphinx.ext.doctest', |
38 |
| - 'sphinx.ext.intersphinx', |
39 |
| - 'sphinx.ext.linkcode', |
40 |
| - 'sphinxcontrib.bibtex', |
41 |
| - 'numpydoc', |
42 |
| - 'sphinx_issues', |
43 |
| - 'sphinx_gallery.gen_gallery', |
| 35 | + "sphinx.ext.autodoc", |
| 36 | + "sphinx.ext.autosummary", |
| 37 | + "sphinx.ext.doctest", |
| 38 | + "sphinx.ext.intersphinx", |
| 39 | + "sphinx.ext.linkcode", |
| 40 | + "sphinxcontrib.bibtex", |
| 41 | + "numpydoc", |
| 42 | + "sphinx_issues", |
| 43 | + "sphinx_gallery.gen_gallery", |
44 | 44 | ]
|
45 | 45 |
|
46 | 46 | # bibtex file
|
|
50 | 50 | # see https://github.com/numpy/numpydoc/issues/69
|
51 | 51 | numpydoc_show_class_members = False
|
52 | 52 |
|
53 |
| -extensions.append('sphinx.ext.imgmath') |
54 |
| -imgmath_image_format = 'svg' |
| 53 | +extensions.append("sphinx.ext.imgmath") |
| 54 | +imgmath_image_format = "svg" |
55 | 55 |
|
56 | 56 | autodoc_default_options = {
|
57 | 57 | "members": True,
|
58 | 58 | "inherited-members": True,
|
59 | 59 | }
|
60 | 60 |
|
61 | 61 | # Add any paths that contain templates here, relative to this directory.
|
62 |
| -templates_path = ['_templates'] |
| 62 | +templates_path = ["_templates"] |
63 | 63 |
|
64 | 64 | # generate autosummary even if no references
|
65 | 65 | autosummary_generate = True
|
66 | 66 |
|
67 | 67 | # The suffix of source filenames.
|
68 |
| -source_suffix = '.rst' |
| 68 | +source_suffix = ".rst" |
69 | 69 |
|
70 | 70 | # The encoding of source files.
|
71 | 71 | # source_encoding = 'utf-8-sig'
|
|
74 | 74 | plot_gallery = True
|
75 | 75 |
|
76 | 76 | # The master toctree document.
|
77 |
| -master_doc = 'index' |
| 77 | +master_doc = "index" |
78 | 78 |
|
79 | 79 | # General information about the project.
|
80 | 80 | project = 'imbalanced-learn'
|
|
86 | 86 | #
|
87 | 87 | # The short X.Y version.
|
88 | 88 | from imblearn import __version__
|
| 89 | + |
89 | 90 | version = __version__
|
90 | 91 | # The full version, including alpha/beta/rc tags.
|
91 | 92 | release = __version__
|
|
102 | 103 |
|
103 | 104 | # List of patterns, relative to source directory, that match files and
|
104 | 105 | # directories to ignore when looking for source files.
|
105 |
| -exclude_patterns = ['_build', '_templates'] |
| 106 | +exclude_patterns = ["_build", "_templates"] |
106 | 107 |
|
107 | 108 | # The reST default role (used for this markup: `text`) to use for all
|
108 | 109 | # documents.
|
109 |
| -default_role = 'literal' |
| 110 | +default_role = "literal" |
110 | 111 |
|
111 | 112 |
|
112 | 113 | # If true, '()' will be appended to :func: etc. cross-reference text.
|
|
121 | 122 | # show_authors = False
|
122 | 123 |
|
123 | 124 | # The name of the Pygments (syntax highlighting) style to use.
|
124 |
| -pygments_style = 'sphinx' |
| 125 | +pygments_style = "sphinx" |
125 | 126 |
|
126 | 127 | # Custom style
|
127 |
| -html_style = 'css/imbalanced-learn.css' |
| 128 | +html_style = "css/imbalanced-learn.css" |
128 | 129 |
|
129 | 130 | # A list of ignored prefixes for module index sorting.
|
130 | 131 | # modindex_common_prefix = []
|
|
136 | 137 |
|
137 | 138 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
138 | 139 | # a list of builtin themes.
|
139 |
| -html_theme = 'sphinx_rtd_theme' |
| 140 | +html_theme = "sphinx_rtd_theme" |
140 | 141 |
|
141 | 142 | # Theme options are theme-specific and customize the look and feel of a theme
|
142 | 143 | # further. For a list of options available for each theme, see the
|
|
165 | 166 | # Add any paths that contain custom static files (such as style sheets) here,
|
166 | 167 | # relative to this directory. They are copied after the builtin static files,
|
167 | 168 | # so a file named "default.css" will overwrite the builtin "default.css".
|
168 |
| -html_static_path = ['_static'] |
| 169 | +html_static_path = ["_static"] |
169 | 170 |
|
170 | 171 | # Add any extra paths that contain custom files (such as robots.txt or
|
171 | 172 | # .htaccess) here, relative to this directory. These files are copied
|
|
214 | 215 | # html_file_suffix = None
|
215 | 216 |
|
216 | 217 | # Output file base name for HTML help builder.
|
217 |
| -htmlhelp_basename = 'imbalanced-learndoc' |
| 218 | +htmlhelp_basename = "imbalanced-learndoc" |
218 | 219 |
|
219 | 220 | # -- Options for LaTeX output ---------------------------------------------
|
220 | 221 |
|
221 | 222 | latex_elements = {
|
222 | 223 | # The paper size ('letterpaper' or 'a4paper').
|
223 | 224 | # 'papersize': 'letterpaper',
|
224 |
| - |
225 | 225 | # The font size ('10pt', '11pt' or '12pt').
|
226 | 226 | # 'pointsize': '10pt',
|
227 |
| - |
228 | 227 | # Additional stuff for the LaTeX preamble.
|
229 | 228 | # 'preamble': '',
|
230 | 229 | }
|
|
233 | 232 | # (source start file, target name, title,
|
234 | 233 | # author, documentclass [howto, manual, or own class]).
|
235 | 234 | latex_documents = [
|
236 |
| - ('index', 'imbalanced-learn.tex', 'imbalanced-learn Documentation', |
237 |
| - 'G. Lemaitre, F. Nogueira, D. Oliveira, C. Aridas', 'manual'), |
| 235 | + ( |
| 236 | + "index", |
| 237 | + "imbalanced-learn.tex", |
| 238 | + "imbalanced-learn Documentation", |
| 239 | + "G. Lemaitre, F. Nogueira, D. Oliveira, C. Aridas", |
| 240 | + "manual", |
| 241 | + ), |
238 | 242 | ]
|
239 | 243 |
|
240 | 244 | # The name of an image file (relative to this directory) to place at the top of
|
|
256 | 260 |
|
257 | 261 | # intersphinx configuration
|
258 | 262 | intersphinx_mapping = {
|
259 |
| - 'python': ('https://docs.python.org/{.major}'.format( |
260 |
| - sys.version_info), None), |
261 |
| - 'numpy': ('https://docs.scipy.org/doc/numpy/', None), |
262 |
| - 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None), |
263 |
| - 'matplotlib': ('https://matplotlib.org/', None), |
264 |
| - 'sklearn': ('http://scikit-learn.org/stable', None) |
| 263 | + "python": ("https://docs.python.org/{.major}".format(sys.version_info), None,), |
| 264 | + "numpy": ("https://docs.scipy.org/doc/numpy/", None), |
| 265 | + "scipy": ("https://docs.scipy.org/doc/scipy/reference", None), |
| 266 | + "matplotlib": ("https://matplotlib.org/", None), |
| 267 | + "sklearn": ("http://scikit-learn.org/stable", None), |
265 | 268 | }
|
266 | 269 |
|
267 | 270 | # sphinx-gallery configuration
|
268 | 271 | sphinx_gallery_conf = {
|
269 |
| - 'doc_module': 'imblearn', |
270 |
| - 'backreferences_dir': os.path.join('generated'), |
271 |
| - 'show_memory': True, |
272 |
| - 'reference_url': { |
273 |
| - 'imblearn': None} |
| 272 | + "doc_module": "imblearn", |
| 273 | + "backreferences_dir": os.path.join("generated"), |
| 274 | + "show_memory": True, |
| 275 | + "reference_url": {"imblearn": None}, |
274 | 276 | }
|
275 | 277 |
|
276 | 278 | # -- Options for manual page output ---------------------------------------
|
|
281 | 283 |
|
282 | 284 | # One entry per manual page. List of tuples
|
283 | 285 | # (source start file, name, description, authors, manual section).
|
284 |
| -man_pages = [('index', 'imbalanced-learn', 'imbalanced-learn Documentation', |
285 |
| - ['G. Lemaitre, F. Nogueira, D. Oliveira, C. Aridas'], 1)] |
| 286 | +man_pages = [ |
| 287 | + ( |
| 288 | + "index", |
| 289 | + "imbalanced-learn", |
| 290 | + "imbalanced-learn Documentation", |
| 291 | + ["G. Lemaitre, F. Nogueira, D. Oliveira, C. Aridas"], |
| 292 | + 1, |
| 293 | + ) |
| 294 | +] |
286 | 295 |
|
287 | 296 | # If true, show URL addresses after external links.
|
288 | 297 | # man_show_urls = False
|
|
293 | 302 | # (source start file, target name, title, author,
|
294 | 303 | # dir menu entry, description, category)
|
295 | 304 | texinfo_documents = [
|
296 |
| - ('index', 'imbalanced-learn', 'imbalanced-learn Documentation', |
297 |
| - 'G. Lemaitre, F. Nogueira, D. Oliveira, C. Aridas', 'imbalanced-learn', |
298 |
| - 'Toolbox for imbalanced dataset in machine learning.', 'Miscellaneous'), |
| 305 | + ( |
| 306 | + "index", |
| 307 | + "imbalanced-learn", |
| 308 | + "imbalanced-learn Documentation", |
| 309 | + "G. Lemaitre, F. Nogueira, D. Oliveira, C. Aridas", |
| 310 | + "imbalanced-learn", |
| 311 | + "Toolbox for imbalanced dataset in machine learning.", |
| 312 | + "Miscellaneous", |
| 313 | + ), |
299 | 314 | ]
|
300 | 315 |
|
301 | 316 |
|
|
311 | 326 |
|
312 | 327 | # Config for sphinx_issues
|
313 | 328 |
|
314 |
| -issues_uri = 'https://github.com/scikit-learn-contrib/imbalanced-learn/issues/{issue}' |
315 |
| -issues_github_path = 'scikit-learn-contrib/imbalanced-learn' |
316 |
| -issues_user_uri = 'https://github.com/{user}' |
| 329 | +issues_uri = "https://github.com/scikit-learn-contrib/imbalanced-learn/issues/{issue}" |
| 330 | +issues_github_path = "scikit-learn-contrib/imbalanced-learn" |
| 331 | +issues_user_uri = "https://github.com/{user}" |
317 | 332 |
|
318 | 333 | # Hack to get kwargs to appear in docstring #18434
|
319 | 334 | # TODO: Remove when https://github.com/sphinx-doc/sphinx/pull/8234 gets
|
@@ -366,7 +381,9 @@ def setup(app):
|
366 | 381 | # texinfo_no_detailmenu = False
|
367 | 382 |
|
368 | 383 | # The following is used by sphinx.ext.linkcode to provide links to github
|
369 |
| -linkcode_resolve = make_linkcode_resolve('imblearn', |
370 |
| - 'https://github.com/scikit-learn-contrib/' |
371 |
| - 'imbalanced-learn/blob/{revision}/' |
372 |
| - '{package}/{path}#L{lineno}') |
| 384 | +linkcode_resolve = make_linkcode_resolve( |
| 385 | + "imblearn", |
| 386 | + "https://github.com/scikit-learn-contrib/" |
| 387 | + "imbalanced-learn/blob/{revision}/" |
| 388 | + "{package}/{path}#L{lineno}", |
| 389 | +) |
0 commit comments