Completed
Pull Request — master (#367)
by
unknown
01:20
created

setup()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
dl 0
loc 2
rs 10
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
#
4
# MetPy documentation build configuration file, created by
5
# sphinx-quickstart on Wed Apr 22 15:27:44 2015.
6
#
7
# This file is execfile()d with the current directory set to its
8
# containing dir.
9
#
10
# Note that not all possible configuration values are present in this
11
# autogenerated file.
12
#
13
# All configuration values have a default; values that are commented out
14
# serve to show the default.
15
16
import sys
17
import os
18
19
import metpy
20
21
22
# If extensions (or modules to document with autodoc) are in another directory,
23
# add these directories to sys.path here. If the directory is relative to the
24
# documentation root, use os.path.abspath to make it absolute, like shown here.
25
sys.path.insert(0, os.path.abspath('.'))
26
sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))
27
28
# -- General configuration ------------------------------------------------
29
30
# If your documentation needs a minimal Sphinx version, state it here.
31
# needs_sphinx = '1.0'
32
33
# Add any Sphinx extension module names here, as strings. They can be
34
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35
# ones.
36
extensions = [
37
    'sphinx.ext.autodoc',
38
    'sphinx.ext.autosummary',
39
    'sphinx.ext.coverage',
40
    'sphinx.ext.intersphinx',
41
    'sphinx.ext.mathjax',
42
    'sphinx.ext.napoleon',
43
    'sphinx_gallery.gen_gallery',
44
    'matplotlib.sphinxext.plot_directive'
45
]
46
47
sphinx_gallery_conf = {
48
    'doc_module': ('metpy',),
49
    'reference_url': {
50
        'metpy': None,
51
        'matplotlib': 'http://matplotlib.org',
52
        'numpy': 'http://docs.scipy.org/doc/numpy/',
53
        'scipy': 'http://docs.scipy.org/doc/scipy/reference'},
54
    'examples_dirs': [os.path.join('..', 'examples'), os.path.join('..', 'tutorials')],
55
    'gallery_dirs': ['examples', 'tutorials'],
56
    'filename_pattern': os.path.join('.', '*'),
57
    'mod_example_dir': os.path.join('api', 'generated'),
58
    'default_thumb_file': os.path.join('_static', 'metpy_150x150_white_bg.png')
59
    'abort_on_example_error': True
60
}
61
62
# Turn off code and image links for embedded mpl plots
63
plot_html_show_source_link = False
64
plot_html_show_formats = False
65
66
mathjax_path = 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
67
# autosummary_generate = True
68
69
# Set up mapping for other projects' docs
70
intersphinx_mapping = {
71
                       # 'pint': ('http://pint.readthedocs.io/en/stable/', None),
72
                       'matplotlib': ('http://matplotlib.org/', None),
73
                       'python': ('https://docs.python.org/3/', None),
74
                       'numpy': ('https://docs.scipy.org/doc/numpy/', None),
75
                       'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None)
76
                       }
77
78
# Tweak how docs are formatted
79
napoleon_use_rtype = False
80
81
# Control main class documentation
82
autoclass_content = 'both'
83
84
# Add any paths that contain templates here, relative to this directory.
85
templates_path = ['_templates']
86
87
# The suffix of source filenames.
88
source_suffix = '.rst'
89
90
# The encoding of source files.
91
# source_encoding = 'utf-8-sig'
92
93
# The master toctree document.
94
master_doc = 'index'
95
96
# General information about the project.
97
project = 'MetPy'
98
# noinspection PyShadowingBuiltins
99
copyright = '2016, MetPy Developers'
100
101
# The version info for the project you're documenting, acts as replacement for
102
# |version| and |release|, also used in various other places throughout the
103
# built documents.
104
#
105
# The short X.Y version.
106
verinfo = metpy.__version__
107
version = verinfo.split('+')[0]
108
# The full version, including alpha/beta/rc tags.
109
release = verinfo
110
111
# The language for content autogenerated by Sphinx. Refer to documentation
112
# for a list of supported languages.
113
# language = None
114
115
# There are two options for replacing |today|: either, you set today to some
116
# non-false value, then it is used:
117
# today = ''
118
# Else, today_fmt is used as the format for a strftime call.
119
today_fmt = '%B %d, %Y'
120
121
# List of patterns, relative to source directory, that match files and
122
# directories to ignore when looking for source files.
123
exclude_patterns = []
124
125
# The reST default role (used for this markup: `text`) to use for all
126
# documents.
127
default_role = 'autolink'
128
129
# If true, '()' will be appended to :func: etc. cross-reference text.
130
# add_function_parentheses = True
131
132
# If true, the current module name will be prepended to all description
133
# unit titles (such as .. function::).
134
# add_module_names = True
135
136
# If true, sectionauthor and moduleauthor directives will be shown in the
137
# output. They are ignored by default.
138
# show_authors = False
139
140
# The name of the Pygments (syntax highlighting) style to use.
141
pygments_style = 'sphinx'
142
143
# A list of ignored prefixes for module index sorting.
144
# modindex_common_prefix = []
145
146
# If true, keep warnings as "system message" paragraphs in the built documents.
147
# keep_warnings = False
148
149
150
# -- Options for HTML output ----------------------------------------------
151
152
# The theme to use for HTML and HTML Help pages.  See the documentation for
153
# a list of builtin themes.
154
# html_theme = 'default'
155
try:
156
    import sphinx_rtd_theme
157
    html_theme = 'sphinx_rtd_theme'
158
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
159
except ImportError:
160
    pass
161
162
163
def setup(app):
164
    app.add_stylesheet('theme_override.css')
165
    
166
# Theme options are theme-specific and customize the look and feel of a theme
167
# further.  For a list of options available for each theme, see the
168
# documentation.
169
# html_theme_options = {}
170
171
# Add any paths that contain custom themes here, relative to this directory.
172
# html_theme_path = []
173
174
# The name for this set of Sphinx documents.  If None, it defaults to
175
# "<project> v<release> documentation".
176
# html_title = None
177
178
# A shorter title for the navigation bar.  Default is the same as html_title.
179
# html_short_title = None
180
181
# The name of an image file (relative to this directory) to place at the top
182
# of the sidebar.
183
html_logo = os.path.join('_static', 'metpy_150x150.png')
184
185
# The name of an image file (within the static path) to use as favicon of the
186
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
187
# pixels large.
188
html_favicon = os.path.join('_static', 'metpy_32x32.ico')
189
190
# Add any paths that contain custom static files (such as style sheets) here,
191
# relative to this directory. They are copied after the builtin static files,
192
# so a file named "default.css" will overwrite the builtin "default.css".
193
html_static_path = ['_static']
194
195
# Add any extra paths that contain custom files (such as robots.txt or
196
# .htaccess) here, relative to this directory. These files are copied
197
# directly to the root of the documentation.
198
# html_extra_path = []
199
200
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
201
# using the given strftime format.
202
html_last_updated_fmt = '%b %d, %Y at %H:%M:%S'
203
204
# If true, SmartyPants will be used to convert quotes and dashes to
205
# typographically correct entities.
206
# html_use_smartypants = True
207
208
# Custom sidebar templates, maps document names to template names.
209
# html_sidebars = {}
210
211
# Additional templates that should be rendered to pages, maps page names to
212
# template names.
213
# html_additional_pages = {}
214
215
# If false, no module index is generated.
216
# html_domain_indices = True
217
218
# If false, no index is generated.
219
# html_use_index = True
220
221
# If true, the index is split into individual pages for each letter.
222
# html_split_index = False
223
224
# If true, links to the reST sources are added to the pages.
225
# html_show_sourcelink = True
226
227
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
228
# html_show_sphinx = True
229
230
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
231
# html_show_copyright = True
232
233
# If true, an OpenSearch description file will be output, and all pages will
234
# contain a <link> tag referring to it.  The value of this option must be the
235
# base URL from which the finished HTML is served.
236
# html_use_opensearch = ''
237
238
# This is the file name suffix for HTML files (e.g. ".xhtml").
239
# html_file_suffix = None
240
241
# Output file base name for HTML help builder.
242
htmlhelp_basename = 'MetPydoc'
243
244
245
# -- Options for LaTeX output ---------------------------------------------
246
247
latex_elements = {
248
    # The paper size ('letterpaper' or 'a4paper').
249
    # 'papersize': 'letterpaper',
250
251
    # The font size ('10pt', '11pt' or '12pt').
252
    # 'pointsize': '10pt',
253
254
    # Additional stuff for the LaTeX preamble.
255
    # 'preamble': '',
256
}
257
258
# Grouping the document tree into LaTeX files. List of tuples
259
# (source start file, target name, title,
260
#  author, documentclass [howto, manual, or own class]).
261
latex_documents = [
262
  ('index', 'MetPy.tex', 'MetPy Documentation',
263
   'MetPy Developers', 'manual'),
264
]
265
266
# The name of an image file (relative to this directory) to place at the top of
267
# the title page.
268
# latex_logo = None
269
270
# For "manual" documents, if this is true, then toplevel headings are parts,
271
# not chapters.
272
# latex_use_parts = False
273
274
# If true, show page references after internal links.
275
# latex_show_pagerefs = False
276
277
# If true, show URL addresses after external links.
278
# latex_show_urls = False
279
280
# Documents to append as an appendix to all manuals.
281
# latex_appendices = []
282
283
# If false, no module index is generated.
284
# latex_domain_indices = True
285
286
287
# -- Options for manual page output ---------------------------------------
288
289
# One entry per manual page. List of tuples
290
# (source start file, name, description, authors, manual section).
291
man_pages = [
292
    ('index', 'metpy', 'MetPy Documentation',
293
     ['MetPy Developers'], 1)
294
]
295
296
# If true, show URL addresses after external links.
297
# man_show_urls = False
298
299
# -- Options for Texinfo output -------------------------------------------
300
301
# Grouping the document tree into Texinfo files. List of tuples
302
# (source start file, target name, title, author,
303
#  dir menu entry, description, category)
304
texinfo_documents = [
305
  ('index', 'MetPy', 'MetPy Documentation',
306
   'MetPy Developers', 'MetPy', 'One line description of project.',
307
   'Miscellaneous'),
308
]
309
310
# Documents to append as an appendix to all manuals.
311
# texinfo_appendices = []
312
313
# If false, no module index is generated.
314
# texinfo_domain_indices = True
315
316
# How to display URL addresses: 'footnote', 'no', or 'inline'.
317
# texinfo_show_urls = 'footnote'
318
319
# If true, do not generate a @detailmenu in the "Top" node's menu.
320
# texinfo_no_detailmenu = False
321
322
# -----------------------------------------------------------------------------
323
# Autosummary
324
# -----------------------------------------------------------------------------
325
326
import glob
327
autosummary_generate = glob.glob(os.path.join('api', '*.rst'))
328