Passed
Push — master ( 4497b8...dc2c24 )
by Fernando
01:19
created

conf   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 196
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 50
dl 0
loc 196
rs 10
c 0
b 0
f 0
1
#
2
# Configuration file for the Sphinx documentation builder.
3
#
4
# This file does only contain a selection of the most common options. For a
5
# full list see the documentation:
6
# http://www.sphinx-doc.org/en/master/config
7
8
# -- Path setup --------------------------------------------------------------
9
10
# If extensions (or modules to document with autodoc) are in another directory,
11
# add these directories to sys.path here. If the directory is relative to the
12
# documentation root, use os.path.abspath to make it absolute, like shown here.
13
#
14
import os
15
import sys
16
from typing import List
17
sys.path.insert(0, os.path.abspath('../..'))
18
sys.path.append(os.path.abspath('sphinxext'))
19
20
# -- Project information -----------------------------------------------------
21
22
project = 'TorchIO'
23
copyright = '2020, Fernando Pérez-García'  # noqa: A001
24
author = 'Fernando Pérez-García'
25
26
# version is the short X.Y version
27
# release is the full version, including alpha/beta/rc tags
28
version = release = '0.18.10'
29
30
31
# -- General configuration ---------------------------------------------------
32
33
# If your documentation needs a minimal Sphinx version, state it here.
34
#
35
# needs_sphinx = '1.0'
36
37
# Add any Sphinx extension module names here, as strings. They can be
38
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39
# ones.
40
extensions = [
41
    'sphinx.ext.autodoc',
42
    'sphinx.ext.viewcode',
43
    'sphinx.ext.githubpages',
44
    'sphinx_rtd_theme',
45
    'sphinx.ext.napoleon',
46
    'sphinx.ext.intersphinx',
47
    'matplotlib.sphinxext.plot_directive',
48
]
49
50
# Add mappings
51
# https://kevin.burke.dev/kevin/sphinx-interlinks/
52
intersphinx_mapping = {
53
    'python': ('https://docs.python.org/3', None),
54
    'torch': ('https://pytorch.org/docs/master/', None),  # https://github.com/pytorch/fairseq/blob/adb5b9c71f7ef4fe2f258e0da102d819ab9920ef/docs/conf.py#L131
55
    'torchvision': ('https://pytorch.org/docs/master/', None),
56
    'nibabel': ('https://nipy.org/nibabel/', None),
57
    'numpy': ('https://numpy.org/doc/stable/', None),
58
}
59
60
# Add any paths that contain templates here, relative to this directory.
61
templates_path = ['_templates']
62
63
# The suffix(es) of source filenames.
64
# You can specify multiple suffix as a list of string:
65
#
66
# source_suffix = ['.rst', '.md']
67
source_suffix = '.rst'
68
69
# The master toctree document.
70
master_doc = 'index'
71
72
# The language for content autogenerated by Sphinx. Refer to documentation
73
# for a list of supported languages.
74
#
75
# This is also used if you do content translation via gettext catalogs.
76
# Usually you set "language" from the command line for these cases.
77
language = None
78
79
# List of patterns, relative to source directory, that match files and
80
# directories to ignore when looking for source files.
81
# This pattern also affects html_static_path and html_extra_path.
82
exclude_patterns: List[str] = []
83
84
# The name of the Pygments (syntax highlighting) style to use.
85
pygments_style = None
86
87
88
# -- Options for HTML output -------------------------------------------------
89
90
# The theme to use for HTML and HTML Help pages.  See the documentation for
91
# a list of builtin themes.
92
#
93
html_theme = 'sphinx_rtd_theme'
94
95
# Theme options are theme-specific and customize the look and feel of a theme
96
# further.  For a list of options available for each theme, see the
97
# documentation.
98
#
99
html_theme_options = {
100
    'navigation_depth': 3,
101
}
102
103
# Add any paths that contain custom static files (such as style sheets) here,
104
# relative to this directory. They are copied after the builtin static files,
105
# so a file named "default.css" will overwrite the builtin "default.css".
106
html_static_path = ['_static']
107
108
# Custom sidebar templates, must be a dictionary that maps document names
109
# to template names.
110
#
111
# The default sidebars (for documents that don't match any pattern) are
112
# defined by theme itself.  Builtin themes are using these templates by
113
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
114
# 'searchbox.html']``.
115
#
116
# html_sidebars = {}
117
118
119
# -- Options for HTMLHelp output ---------------------------------------------
120
121
# Output file base name for HTML help builder.
122
htmlhelp_basename = 'TorchIOdoc'
123
124
125
# -- Options for LaTeX output ------------------------------------------------
126
127
latex_elements = {
128
    # The paper size ('letterpaper' or 'a4paper').
129
    #
130
    # 'papersize': 'letterpaper',
131
132
    # The font size ('10pt', '11pt' or '12pt').
133
    #
134
    # 'pointsize': '10pt',
135
136
    # Additional stuff for the LaTeX preamble.
137
    #
138
    # 'preamble': '',
139
140
    # Latex figure (float) alignment
141
    #
142
    # 'figure_align': 'htbp',
143
}
144
145
# Grouping the document tree into LaTeX files. List of tuples
146
# (source start file, target name, title,
147
#  author, documentclass [howto, manual, or own class]).
148
latex_documents = [
149
    (master_doc, 'TorchIO.tex', 'TorchIO Documentation',
150
     'Fernando Pérez-García', 'manual'),
151
]
152
153
154
# -- Options for manual page output ------------------------------------------
155
156
# One entry per manual page. List of tuples
157
# (source start file, name, description, authors, manual section).
158
man_pages = [
159
    (master_doc, 'torchio', 'TorchIO Documentation',
160
     [author], 1)
161
]
162
163
164
# -- Options for Texinfo output ----------------------------------------------
165
166
# Grouping the document tree into Texinfo files. List of tuples
167
# (source start file, target name, title, author,
168
#  dir menu entry, description, category)
169
texinfo_documents = [
170
    (master_doc, 'TorchIO', 'TorchIO Documentation',
171
     author, 'TorchIO', 'One line description of project.',
172
     'Miscellaneous'),
173
]
174
175
176
# -- Options for Epub output -------------------------------------------------
177
178
# Bibliographic Dublin Core info.
179
epub_title = project
180
181
# The unique identifier of the text. This can be a ISBN number
182
# or the project homepage.
183
#
184
# epub_identifier = ''
185
186
# A unique identification for the text.
187
#
188
# epub_uid = ''
189
190
# A list of files that should not be packed into the epub file.
191
epub_exclude_files = ['search.html']
192
193
194
def setup(app):
195
    app.add_js_file('copybutton.js')
196
197
198
# -- Extension configuration -------------------------------------------------
199