|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# Matplotlib 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 os |
| 15 | +import sys |
| 16 | +import sphinx |
| 17 | + |
| 18 | +# If your extensions are in another directory, add it here. If the directory |
| 19 | +# is relative to the documentation root, use os.path.abspath to make it |
| 20 | +# absolute, like shown here. |
| 21 | +sys.path.append(os.path.abspath('.')) |
| 22 | + |
| 23 | +# General configuration |
| 24 | +# --------------------- |
| 25 | + |
| 26 | +# Add any Sphinx extension module names here, as strings. They can be extensions |
| 27 | +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
| 28 | +extensions = ['matplotlib.sphinxext.mathmpl', 'sphinxext.math_symbol_table', |
| 29 | + 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives', |
| 30 | + 'sphinx.ext.doctest', 'sphinx.ext.autosummary', |
| 31 | + 'matplotlib.sphinxext.plot_directive', |
| 32 | + 'sphinx.ext.inheritance_diagram', |
| 33 | + 'sphinxext.gen_gallery', 'sphinxext.gen_rst', |
| 34 | + 'sphinxext.github', |
| 35 | + 'numpydoc'] |
| 36 | + |
| 37 | +exclude_patterns = ['api/api_changes/*', 'users/whats_new/*'] |
| 38 | + |
| 39 | +# Use IPython's console highlighting by default |
| 40 | +try: |
| 41 | + from IPython.sphinxext import ipython_console_highlighting |
| 42 | +except ImportError: |
| 43 | + extensions.append('matplotlib.sphinxext.ipython_console_highlighting') |
| 44 | +else: |
| 45 | + print("Using IPython's ipython_console_highlighting directive") |
| 46 | + extensions.append('IPython.sphinxext.ipython_directive') |
| 47 | + extensions.append('IPython.sphinxext.ipython_console_highlighting') |
| 48 | + |
| 49 | +try: |
| 50 | + import numpydoc |
| 51 | +except ImportError: |
| 52 | + raise ImportError("No module named numpydoc - you need to install " |
| 53 | + "numpydoc to build the documentation.") |
| 54 | + |
| 55 | + |
| 56 | +autosummary_generate = True |
| 57 | + |
| 58 | +autodoc_docstring_signature = True |
| 59 | + |
| 60 | +# Add any paths that contain templates here, relative to this directory. |
| 61 | +templates_path = ['_templates'] |
| 62 | + |
| 63 | +# The suffix of source filenames. |
| 64 | +source_suffix = '.rst' |
| 65 | + |
| 66 | +# This is the default encoding, but it doesn't hurt to be explicit |
| 67 | +source_encoding = "utf-8" |
| 68 | + |
| 69 | +# The master toctree document. |
| 70 | +master_doc = 'contents' |
| 71 | + |
| 72 | +# General substitutions. |
| 73 | +project = 'Matplotlib' |
| 74 | +copyright = '2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team; 2012 - 2014 The matplotlib development team' |
| 75 | + |
| 76 | +# The default replacements for |version| and |release|, also used in various |
| 77 | +# other places throughout the built documents. |
| 78 | +# |
| 79 | +# The short X.Y version. |
| 80 | +try: |
| 81 | + import matplotlib |
| 82 | +except ImportError: |
| 83 | + msg = "Error: matplotlib must be installed before building the documentation" |
| 84 | + sys.exit(msg) |
| 85 | + |
| 86 | +version = matplotlib.__version__ |
| 87 | +# The full version, including alpha/beta/rc tags. |
| 88 | +release = version |
| 89 | + |
| 90 | +# There are two options for replacing |today|: either, you set today to some |
| 91 | +# non-false value, then it is used: |
| 92 | +#today = '' |
| 93 | +# Else, today_fmt is used as the format for a strftime call. |
| 94 | +today_fmt = '%B %d, %Y' |
| 95 | + |
| 96 | +# List of documents that shouldn't be included in the build. |
| 97 | +unused_docs = [] |
| 98 | + |
| 99 | +# If true, '()' will be appended to :func: etc. cross-reference text. |
| 100 | +#add_function_parentheses = True |
| 101 | + |
| 102 | +# If true, the current module name will be prepended to all description |
| 103 | +# unit titles (such as .. function::). |
| 104 | +#add_module_names = True |
| 105 | + |
| 106 | +# If true, sectionauthor and moduleauthor directives will be shown in the |
| 107 | +# output. They are ignored by default. |
| 108 | +#show_authors = False |
| 109 | + |
| 110 | +# The name of the Pygments (syntax highlighting) style to use. |
| 111 | +pygments_style = 'sphinx' |
| 112 | + |
| 113 | +default_role = 'obj' |
| 114 | + |
| 115 | +# Plot directive configuration |
| 116 | +# ---------------------------- |
| 117 | + |
| 118 | +plot_formats = [('png', 80), ('hires.png', 200), ('pdf', 50)] |
| 119 | + |
| 120 | +# Subdirectories in 'examples/' directory of package and titles for gallery |
| 121 | +mpl_example_sections = ( |
| 122 | + ('lines_bars_and_markers', 'Lines, bars, and markers'), |
| 123 | + ('shapes_and_collections', 'Shapes and collections'), |
| 124 | + ('statistics', 'Statistical plots'), |
| 125 | + ('images_contours_and_fields', 'Images, contours, and fields'), |
| 126 | + ('pie_and_polar_charts', 'Pie and polar charts'), |
| 127 | + ('color', 'Color'), |
| 128 | + ('text_labels_and_annotations', 'Text, labels, and annotations'), |
| 129 | + ('ticks_and_spines', 'Ticks and spines'), |
| 130 | + ('scales', 'Axis scales'), |
| 131 | + ('subplots_axes_and_figures', 'Subplots, axes, and figures'), |
| 132 | + ('style_sheets', 'Style sheets'), |
| 133 | + ('specialty_plots', 'Specialty plots'), |
| 134 | + ('showcase', 'Showcase'), |
| 135 | + ('api', 'API'), |
| 136 | + ('pylab_examples', 'pylab examples'), |
| 137 | + ('mplot3d', 'mplot3d toolkit'), |
| 138 | + ('axes_grid', 'axes_grid toolkit'), |
| 139 | + ('units', 'units'), |
| 140 | + ('widgets', 'widgets'), |
| 141 | + ) |
| 142 | + |
| 143 | + |
| 144 | +# Github extension |
| 145 | + |
| 146 | +github_project_url = "http://github.com/matplotlib/matplotlib/" |
| 147 | + |
| 148 | +# Options for HTML output |
| 149 | +# ----------------------- |
| 150 | + |
| 151 | +# The style sheet to use for HTML and HTML Help pages. A file of that name |
| 152 | +# must exist either in Sphinx' static/ path, or in one of the custom paths |
| 153 | +# given in html_static_path. |
| 154 | +#html_style = 'matplotlib.css' |
| 155 | +html_style = 'mpl.css' |
| 156 | + |
| 157 | +# The name for this set of Sphinx documents. If None, it defaults to |
| 158 | +# "<project> v<release> documentation". |
| 159 | +#html_title = None |
| 160 | + |
| 161 | +# The name of an image file (within the static path) to place at the top of |
| 162 | +# the sidebar. |
| 163 | +#html_logo = 'logo.png' |
| 164 | + |
| 165 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 166 | +# relative to this directory. They are copied after the builtin static files, |
| 167 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 168 | +html_static_path = ['_static'] |
| 169 | + |
| 170 | +# If nonempty, this is the file name suffix for generated HTML files. The |
| 171 | +# default is ``".html"``. |
| 172 | +html_file_suffix = '.html' |
| 173 | + |
| 174 | +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
| 175 | +# using the given strftime format. |
| 176 | +html_last_updated_fmt = '%b %d, %Y' |
| 177 | + |
| 178 | +# If true, SmartyPants will be used to convert quotes and dashes to |
| 179 | +# typographically correct entities. |
| 180 | +#html_use_smartypants = True |
| 181 | + |
| 182 | +# Content template for the index page. |
| 183 | +html_index = 'index.html' |
| 184 | + |
| 185 | +# Custom sidebar templates, maps document names to template names. |
| 186 | +#html_sidebars = {} |
| 187 | + |
| 188 | +# Custom sidebar templates, maps page names to templates. |
| 189 | +html_sidebars = {'index': 'indexsidebar.html', |
| 190 | + } |
| 191 | + |
| 192 | + |
| 193 | +# Additional templates that should be rendered to pages, maps page names to |
| 194 | +# template names. |
| 195 | +html_additional_pages = {'index': 'index.html', |
| 196 | + 'gallery':'gallery.html', |
| 197 | + 'citing': 'citing.html'} |
| 198 | + |
| 199 | +# If false, no module index is generated. |
| 200 | +#html_use_modindex = True |
| 201 | +html_domain_indices = ["py-modindex"] |
| 202 | + |
| 203 | +# If true, the reST sources are included in the HTML build as _sources/<name>. |
| 204 | +#html_copy_source = True |
| 205 | + |
| 206 | +# If true, an OpenSearch description file will be output, and all pages will |
| 207 | +# contain a <link> tag referring to it. |
| 208 | +html_use_opensearch = 'False' |
| 209 | + |
| 210 | +# Output file base name for HTML help builder. |
| 211 | +htmlhelp_basename = 'Matplotlibdoc' |
| 212 | + |
| 213 | + |
| 214 | +# Options for LaTeX output |
| 215 | +# ------------------------ |
| 216 | + |
| 217 | +# The paper size ('letter' or 'a4'). |
| 218 | +latex_paper_size = 'letter' |
| 219 | + |
| 220 | +# The font size ('10pt', '11pt' or '12pt'). |
| 221 | +latex_font_size = '11pt' |
| 222 | + |
| 223 | +# Grouping the document tree into LaTeX files. List of tuples |
| 224 | +# (source start file, target name, title, author, document class [howto/manual]). |
| 225 | + |
| 226 | +latex_documents = [ |
| 227 | + ('contents', 'Matplotlib.tex', 'Matplotlib', |
| 228 | + 'John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the ' |
| 229 | + 'matplotlib development team', 'manual'), |
| 230 | +] |
| 231 | + |
| 232 | + |
| 233 | +# The name of an image file (relative to this directory) to place at the top of |
| 234 | +# the title page. |
| 235 | +latex_logo = None |
| 236 | + |
| 237 | +# Additional stuff for the LaTeX preamble. |
| 238 | +latex_preamble = r""" |
| 239 | + % In the parameters section, place a newline after the Parameters |
| 240 | + % header. (This is stolen directly from Numpy's conf.py, since it |
| 241 | + % affects Numpy-style docstrings). |
| 242 | + \usepackage{expdlist} |
| 243 | + \let\latexdescription=\description |
| 244 | + \def\description{\latexdescription{}{} \breaklabel} |
| 245 | +
|
| 246 | + \usepackage{amsmath} |
| 247 | + \usepackage{amsfonts} |
| 248 | + \usepackage{amssymb} |
| 249 | + \usepackage{txfonts} |
| 250 | +
|
| 251 | + % The enumitem package provides unlimited nesting of lists and |
| 252 | + % enums. Sphinx may use this in the future, in which case this can |
| 253 | + % be removed. See |
| 254 | + % https://bitbucket.org/birkenfeld/sphinx/issue/777/latex-output-too-deeply-nested |
| 255 | + \usepackage{enumitem} |
| 256 | + \setlistdepth{2048} |
| 257 | +""" |
| 258 | + |
| 259 | +# Documents to append as an appendix to all manuals. |
| 260 | +latex_appendices = [] |
| 261 | + |
| 262 | +# If false, no module index is generated. |
| 263 | +latex_use_modindex = True |
| 264 | + |
| 265 | +latex_use_parts = True |
| 266 | + |
| 267 | +# Show both class-level docstring and __init__ docstring in class |
| 268 | +# documentation |
| 269 | +autoclass_content = 'both' |
| 270 | + |
| 271 | +rst_epilog = """ |
| 272 | +.. |minimum_numpy_version| replace:: %s |
| 273 | +""" % matplotlib.__version__numpy__ |
| 274 | + |
| 275 | +texinfo_documents = [ |
| 276 | + ("contents", 'matplotlib', 'Matplotlib Documentation', |
| 277 | + 'John Hunter@*Darren Dale@*Eric Firing@*Michael Droettboom@*' |
| 278 | + 'The matplotlib development team', |
| 279 | + 'Matplotlib', "Python plotting package", 'Programming', |
| 280 | + 1), |
| 281 | +] |
| 282 | + |
| 283 | +try: |
| 284 | + from unittest.mock import MagicMock |
| 285 | +except: |
| 286 | + from mock import MagicMock |
| 287 | + |
| 288 | + |
| 289 | +class MyWX(MagicMock): |
| 290 | + class Panel(object): |
| 291 | + pass |
| 292 | + |
| 293 | + class ToolBar(object): |
| 294 | + pass |
| 295 | + |
| 296 | + class Frame(object): |
| 297 | + pass |
| 298 | + |
| 299 | + VERSION_STRING = '2.8' |
| 300 | + |
| 301 | + |
| 302 | +class MyPyQt4(MagicMock): |
| 303 | + class QtGui(object): |
| 304 | + class QToolBar(object): |
| 305 | + pass |
| 306 | + |
| 307 | + class QDialog(object): |
| 308 | + pass |
| 309 | + |
| 310 | + class QWidget(object): |
| 311 | + pass |
| 312 | + |
| 313 | + class QMainWindow(object): |
| 314 | + pass |
| 315 | + |
| 316 | + |
| 317 | +class MySip(MagicMock): |
| 318 | + def getapi(*args): |
| 319 | + return 1 |
| 320 | + |
| 321 | + |
| 322 | +mockwxversion = MagicMock() |
| 323 | +mockwx = MyWX() |
| 324 | +mocksip = MySip() |
| 325 | +mockpyqt4 = MyPyQt4() |
| 326 | +sys.modules['wxversion'] = mockwxversion |
| 327 | +sys.modules['wx'] = mockwx |
| 328 | +sys.modules['sip'] = mocksip |
| 329 | +sys.modules['PyQt4'] = mockpyqt4 |
| 330 | + |
| 331 | +################# numpydoc config #################### |
| 332 | +numpydoc_show_class_members = False |
0 commit comments