|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | -# |
3 | | -# Quantities documentation build configuration file, created by |
4 | | -# sphinx-quickstart on Fri May 2 12:33:25 2008. |
5 | | -# |
6 | | -# This file is execfile()d with the current directory set to its containing dir. |
7 | | -# |
8 | | -# The contents of this file are pickled, so don't put values in the namespace |
9 | | -# that aren't pickleable (module imports are okay, they're removed automatically). |
10 | | -# |
11 | | -# All configuration values have a default value; values that are commented out |
12 | | -# serve to show the default value. |
13 | | - |
14 | | -import sys, os |
| 2 | + |
| 3 | +import sys, os, re |
15 | 4 |
|
16 | 5 | # Check Sphinx version |
17 | 6 | import sphinx |
18 | 7 | if sphinx.__version__ < "0.5": |
19 | 8 | raise RuntimeError("Sphinx 0.5.dev or newer required") |
20 | 9 |
|
21 | | -# General configuration |
22 | | -# --------------------- |
| 10 | +# ----------------------------------------------------------------------------- |
| 11 | +# General configuration |
| 12 | +# ----------------------------------------------------------------------------- |
23 | 13 |
|
24 | 14 | # Add any Sphinx extension module names here, as strings. They can be extensions |
25 | 15 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
26 | 16 |
|
27 | | -sys.path.append(os.path.abspath('../sphinxext')) |
| 17 | +sys.path.insert(0, os.path.abspath('../sphinxext')) |
28 | 18 |
|
29 | | -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'numpydoc', |
30 | | - 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', |
31 | | - 'only_directives'] |
| 19 | +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'numpydoc', |
| 20 | + 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', |
| 21 | + 'plot_directive'] |
32 | 22 |
|
33 | 23 | if sphinx.__version__ >= "0.7": |
34 | 24 | extensions.append('sphinx.ext.autosummary') |
35 | | - import glob |
36 | | - autosummary_generate = glob.glob("reference/*.rst") |
37 | 25 | else: |
38 | 26 | extensions.append('autosummary') |
| 27 | + extensions.append('only_directives') |
39 | 28 |
|
40 | 29 | # Add any paths that contain templates here, relative to this directory. |
41 | 30 | templates_path = ['_templates'] |
|
69 | 58 | # Else, today_fmt is used as the format for a strftime call. |
70 | 59 | today_fmt = '%B %d, %Y' |
71 | 60 |
|
72 | | -# List of directories, relative to source directory, that shouldn't be searched |
73 | | -# for source files. |
74 | | -exclude_trees = ['_build'] |
| 61 | +# List of documents that shouldn't be included in the build. |
| 62 | +#unused_docs = [] |
75 | 63 |
|
76 | 64 | # The reST default role (used for this markup: `text`) to use for all documents. |
77 | | -#default_role = None |
| 65 | +default_role = 'autolink' |
78 | 66 |
|
79 | | -# List of documents that shouldn't be included in the build. |
80 | | -#unused_docs = [] |
| 67 | +# List of directories, relative to source directories, that shouldn't be searched |
| 68 | +# for source files. |
| 69 | +exclude_dirs = [] |
81 | 70 |
|
82 | 71 | # If true, '()' will be appended to :func: etc. cross-reference text. |
83 | | -#add_function_parentheses = True |
| 72 | +add_function_parentheses = False |
84 | 73 |
|
85 | 74 | # If true, the current module name will be prepended to all description |
86 | 75 | # unit titles (such as .. function::). |
|
93 | 82 | # The name of the Pygments (syntax highlighting) style to use. |
94 | 83 | pygments_style = 'sphinx' |
95 | 84 |
|
96 | | -# A list of ignored prefixes for module index sorting. |
97 | | -#modindex_common_prefix = [] |
98 | | - |
99 | 85 |
|
100 | | -# Options for HTML output |
101 | | -# ----------------------- |
| 86 | +# ----------------------------------------------------------------------------- |
| 87 | +# HTML output |
| 88 | +# ----------------------------------------------------------------------------- |
102 | 89 |
|
103 | 90 | # The style sheet to use for HTML and HTML Help pages. A file of that name |
104 | 91 | # must exist either in Sphinx' static/ path, or in one of the custom paths |
|
169 | 156 | htmlhelp_basename = 'Quantitiesdoc' |
170 | 157 |
|
171 | 158 |
|
172 | | -# Options for LaTeX output |
173 | | -# ------------------------ |
| 159 | +# ----------------------------------------------------------------------------- |
| 160 | +# LaTeX output |
| 161 | +# ----------------------------------------------------------------------------- |
174 | 162 |
|
175 | 163 | # The paper size ('letter' or 'a4'). |
176 | 164 | latex_paper_size = 'letter' |
|
199 | 187 |
|
200 | 188 | latex_use_parts = True |
201 | 189 |
|
202 | | -############################################################# |
203 | | -# numpy extensions |
204 | 190 |
|
205 | | -# Edit links |
206 | | -numpydoc_edit_link = '`Edit </numpy/docs/%(full_name)s/>`__' |
| 191 | +# ----------------------------------------------------------------------------- |
| 192 | +# Intersphinx configuration |
| 193 | +# ----------------------------------------------------------------------------- |
| 194 | +intersphinx_mapping = {'http://docs.python.org/dev': None} |
| 195 | + |
| 196 | + |
| 197 | +# ----------------------------------------------------------------------------- |
| 198 | +# Numpy extensions |
| 199 | +# ----------------------------------------------------------------------------- |
| 200 | + |
| 201 | +# If we want to do a phantom import from an XML file for all autodocs |
| 202 | +phantom_import_file = 'dump.xml' |
| 203 | + |
| 204 | +# Make numpydoc to generate plots for example sections |
| 205 | +numpydoc_use_plots = True |
| 206 | + |
| 207 | +# ----------------------------------------------------------------------------- |
| 208 | +# Autosummary |
| 209 | +# ----------------------------------------------------------------------------- |
| 210 | + |
| 211 | +if sphinx.__version__ >= "0.7": |
| 212 | + import glob |
| 213 | + autosummary_generate = glob.glob("reference/*.rst") |
| 214 | + |
| 215 | +# ----------------------------------------------------------------------------- |
| 216 | +# Coverage checker |
| 217 | +# ----------------------------------------------------------------------------- |
| 218 | +coverage_ignore_modules = r""" |
| 219 | + """.split() |
| 220 | +coverage_ignore_functions = r""" |
| 221 | + test($|_) (some|all)true bitwise_not cumproduct pkgload |
| 222 | + generic\. |
| 223 | + """.split() |
| 224 | +coverage_ignore_classes = r""" |
| 225 | + """.split() |
| 226 | + |
| 227 | +coverage_c_path = [] |
| 228 | +coverage_c_regexes = {} |
| 229 | +coverage_ignore_c_items = {} |
| 230 | + |
| 231 | + |
| 232 | +# ----------------------------------------------------------------------------- |
| 233 | +# Plots |
| 234 | +# ----------------------------------------------------------------------------- |
| 235 | +plot_pre_code = """ |
| 236 | +import numpy as np |
| 237 | +np.random.seed(0) |
| 238 | +""" |
| 239 | +plot_include_source = True |
| 240 | +plot_formats = [('png', 100), 'pdf'] |
| 241 | + |
| 242 | +import math |
| 243 | +phi = (math.sqrt(5) + 1)/2 |
| 244 | + |
| 245 | +import matplotlib |
| 246 | +matplotlib.rcParams.update({ |
| 247 | + 'font.size': 8, |
| 248 | + 'axes.titlesize': 8, |
| 249 | + 'axes.labelsize': 8, |
| 250 | + 'xtick.labelsize': 8, |
| 251 | + 'ytick.labelsize': 8, |
| 252 | + 'legend.fontsize': 8, |
| 253 | + 'figure.figsize': (3*phi, 3), |
| 254 | + 'figure.subplot.bottom': 0.2, |
| 255 | + 'figure.subplot.left': 0.2, |
| 256 | + 'figure.subplot.right': 0.9, |
| 257 | + 'figure.subplot.top': 0.85, |
| 258 | + 'figure.subplot.wspace': 0.4, |
| 259 | + 'text.usetex': False, |
| 260 | +}) |
0 commit comments