|
9 | 9 | import os |
10 | 10 | import sys |
11 | 11 |
|
12 | | -sys.path.insert(0, os.path.abspath('../..')) |
| 12 | +sys.path.insert(0, os.path.abspath("../..")) |
13 | 13 | sys.path.insert(0, os.path.abspath("sphinxext")) |
14 | 14 |
|
15 | 15 |
|
16 | 16 | # -- Project information ----------------------------------------------------- |
17 | 17 |
|
18 | | -project = 'stabilized-ica' |
19 | | -copyright = 'Copyright 2022, Nicolas Captier (built with a theme provided by the scikit-learn developers (BSD License))' |
20 | | -author = 'Nicolas Captier' |
21 | | -release = '2.0.0' |
| 18 | +project = "stabilized-ica" |
| 19 | +copyright = "Copyright 2022, Nicolas Captier (built with a theme provided by the scikit-learn developers (BSD License))" |
| 20 | +author = "Nicolas Captier" |
| 21 | +release = "2.0.0" |
22 | 22 |
|
23 | 23 | # -- General configuration --------------------------------------------------- |
24 | 24 |
|
25 | 25 | # Add any Sphinx extension module names here, as strings. They can be |
26 | 26 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
27 | 27 | # ones. |
28 | | -extensions = ['sphinx.ext.autodoc', |
29 | | - 'sphinx.ext.autosummary', |
30 | | - 'sphinx.ext.coverage', |
31 | | - 'numpydoc', |
32 | | - 'sphinx.ext.linkcode', |
33 | | - 'sphinx.ext.autosectionlabel', |
34 | | - 'sphinx_gallery.load_style', |
35 | | - 'nbsphinx', |
36 | | - 'add_toctree_functions'] |
| 28 | +extensions = [ |
| 29 | + "sphinx.ext.autodoc", |
| 30 | + "sphinx.ext.autosummary", |
| 31 | + "sphinx.ext.coverage", |
| 32 | + "numpydoc", |
| 33 | + "sphinx.ext.linkcode", |
| 34 | + "sphinx.ext.autosectionlabel", |
| 35 | + "sphinx_gallery.load_style", |
| 36 | + "nbsphinx", |
| 37 | + "add_toctree_functions", |
| 38 | +] |
| 39 | + |
| 40 | +autodoc_typehints = "none" |
37 | 41 |
|
| 42 | +autodoc_default_options = {"members": True, "inherited-members": True} |
38 | 43 |
|
39 | 44 | autosectionlabel_prefix_document = True |
40 | 45 |
|
|
50 | 55 | extensions.append("sphinx.ext.mathjax") |
51 | 56 | mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js" |
52 | 57 |
|
53 | | -autodoc_default_options = {"members": True, "inherited-members": True} |
54 | | - |
55 | 58 | # Add any paths that contain templates here, relative to this directory. |
56 | | -templates_path = ['_templates'] |
| 59 | +templates_path = ["_templates"] |
57 | 60 |
|
58 | 61 | # generate autosummary even if no references |
59 | 62 | autosummary_generate = True |
|
63 | 66 |
|
64 | 67 | # The main toctree document. |
65 | 68 | main_doc = "contents" |
66 | | -master_doc = 'index' |
| 69 | +master_doc = "index" |
67 | 70 |
|
68 | 71 | # List of patterns, relative to source directory, that match files and |
69 | 72 | # directories to ignore when looking for source files. |
|
78 | 81 | add_function_parentheses = False |
79 | 82 |
|
80 | 83 | # The name of the Pygments (syntax highlighting) style to use. |
81 | | -#pygments_style = "sphinx" |
| 84 | +pygments_style = "sphinx" |
82 | 85 |
|
83 | 86 | # -- Options for HTML output ------------------------------------------------- |
84 | 87 |
|
@@ -111,20 +114,21 @@ def linkcode_resolve(domain, info): |
111 | 114 | def find_source(): |
112 | 115 | # try to find the file and line number, based on code from numpy: |
113 | 116 | # https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L286 |
114 | | - obj = sys.modules[info['module']] |
115 | | - for part in info['fullname'].split('.'): |
| 117 | + obj = sys.modules[info["module"]] |
| 118 | + for part in info["fullname"].split("."): |
116 | 119 | obj = getattr(obj, part) |
117 | 120 | import inspect |
118 | 121 | import os |
| 122 | + |
119 | 123 | fn = inspect.getsourcefile(obj) |
120 | 124 | fn = os.path.relpath(fn, start=os.path.dirname(sica.__file__)) |
121 | 125 | source, lineno = inspect.getsourcelines(obj) |
122 | 126 | return fn, lineno, lineno + len(source) - 1 |
123 | 127 |
|
124 | | - if domain != 'py' or not info['module']: |
| 128 | + if domain != "py" or not info["module"]: |
125 | 129 | return None |
126 | 130 | try: |
127 | | - filename = 'sica/%s#L%d-L%d' % find_source() |
| 131 | + filename = "sica/%s#L%d-L%d" % find_source() |
128 | 132 | except Exception: |
129 | | - filename = info['module'].replace('.', '/') + '.py' |
| 133 | + filename = info["module"].replace(".", "/") + ".py" |
130 | 134 | return "https://github.com/ncaptier/stabilized-ica/blob/master/%s" % filename |
0 commit comments