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