Diff of /docs/conf.py [000000] .. [3b722e]

Switch to unified view

a b/docs/conf.py
1
# -*- coding: utf-8 -*-
2
#
3
# ODDT documentation build configuration file, created by
4
# sphinx-quickstart on Mon Aug 25 13:49:30 2014.
5
#
6
# This file is execfile()d with the current directory set to its
7
# containing dir.
8
#
9
# Note that not all possible configuration values are present in this
10
# autogenerated file.
11
#
12
# All configuration values have a default; values that are commented out
13
# serve to show the default.
14
15
import sys
16
import os
17
18
# If extensions (or modules to document with autodoc) are in another directory,
19
# add these directories to sys.path here. If the directory is relative to the
20
# documentation root, use os.path.abspath to make it absolute, like shown here.
21
sys.path.insert(0, os.path.abspath('..'))
22
23
# -- General configuration ------------------------------------------------
24
25
# If your documentation needs a minimal Sphinx version, state it here.
26
#needs_sphinx = '1.0'
27
28
# Add any Sphinx extension module names here, as strings. They can be
29
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30
# ones.
31
extensions = [
32
    'sphinx.ext.autodoc',
33
    'sphinx.ext.autosummary',
34
    'sphinx.ext.doctest',
35
    'sphinx.ext.mathjax',
36
    'sphinx.ext.intersphinx',
37
    'sphinx.ext.viewcode',
38
    'numpydoc',
39
]
40
41
autosummary_generate = True
42
43
autodoc_default_flags = ['members', 'inherited-members', 'imported-members']
44
autoclass_content = 'init'
45
46
# Add any paths that contain templates here, relative to this directory.
47
templates_path = ['_templates']
48
49
# The suffix of source filenames.
50
source_suffix = '.rst'
51
52
# The encoding of source files.
53
#source_encoding = 'utf-8-sig'
54
55
# The master toctree document.
56
master_doc = 'index'
57
58
# General information about the project.
59
project = u'Open Drug Discovery Toolkit'
60
copyright = u'2015, Maciej Wojcikowski'
61
62
# The version info for the project you're documenting, acts as replacement for
63
# |version| and |release|, also used in various other places throughout the
64
# built documents.
65
#
66
from oddt import __version__ as VERSION
67
# The short X.Y version.
68
version = VERSION
69
# The full version, including alpha/beta/rc tags.
70
release = VERSION
71
72
# The language for content autogenerated by Sphinx. Refer to documentation
73
# for a list of supported languages.
74
#language = None
75
76
# There are two options for replacing |today|: either, you set today to some
77
# non-false value, then it is used:
78
#today = ''
79
# Else, today_fmt is used as the format for a strftime call.
80
#today_fmt = '%B %d, %Y'
81
82
# List of patterns, relative to source directory, that match files and
83
# directories to ignore when looking for source files.
84
exclude_patterns = ['_build']
85
86
# The reST default role (used for this markup: `text`) to use for all
87
# documents.
88
#default_role = None
89
90
# If true, '()' will be appended to :func: etc. cross-reference text.
91
#add_function_parentheses = True
92
93
# If true, the current module name will be prepended to all description
94
# unit titles (such as .. function::).
95
#add_module_names = True
96
97
# If true, sectionauthor and moduleauthor directives will be shown in the
98
# output. They are ignored by default.
99
#show_authors = False
100
101
# The name of the Pygments (syntax highlighting) style to use.
102
pygments_style = 'sphinx'
103
104
# A list of ignored prefixes for module index sorting.
105
#modindex_common_prefix = []
106
107
# If true, keep warnings as "system message" paragraphs in the built documents.
108
#keep_warnings = False
109
110
111
# -- Options for HTML output ----------------------------------------------
112
113
# The theme to use for HTML and HTML Help pages.  See the documentation for
114
# a list of builtin themes.
115
html_theme = 'default'
116
117
# Theme options are theme-specific and customize the look and feel of a theme
118
# further.  For a list of options available for each theme, see the
119
# documentation.
120
#html_theme_options = {}
121
122
# Add any paths that contain custom themes here, relative to this directory.
123
#html_theme_path = []
124
125
# The name for this set of Sphinx documents.  If None, it defaults to
126
# "<project> v<release> documentation".
127
#html_title = None
128
129
# A shorter title for the navigation bar.  Default is the same as html_title.
130
#html_short_title = None
131
132
# The name of an image file (relative to this directory) to place at the top
133
# of the sidebar.
134
#html_logo = None
135
136
# The name of an image file (within the static path) to use as favicon of the
137
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
138
# pixels large.
139
#html_favicon = None
140
141
# Add any paths that contain custom static files (such as style sheets) here,
142
# relative to this directory. They are copied after the builtin static files,
143
# so a file named "default.css" will overwrite the builtin "default.css".
144
html_static_path = ['_static']
145
146
# Add any extra paths that contain custom files (such as robots.txt or
147
# .htaccess) here, relative to this directory. These files are copied
148
# directly to the root of the documentation.
149
#html_extra_path = []
150
151
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
152
# using the given strftime format.
153
#html_last_updated_fmt = '%b %d, %Y'
154
155
# If true, SmartyPants will be used to convert quotes and dashes to
156
# typographically correct entities.
157
#html_use_smartypants = True
158
159
# Custom sidebar templates, maps document names to template names.
160
#html_sidebars = {}
161
162
# Additional templates that should be rendered to pages, maps page names to
163
# template names.
164
#html_additional_pages = {}
165
166
# If false, no module index is generated.
167
#html_domain_indices = True
168
169
# If false, no index is generated.
170
#html_use_index = True
171
172
# If true, the index is split into individual pages for each letter.
173
#html_split_index = False
174
175
# If true, links to the reST sources are added to the pages.
176
#html_show_sourcelink = True
177
178
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
179
#html_show_sphinx = True
180
181
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
182
#html_show_copyright = True
183
184
# If true, an OpenSearch description file will be output, and all pages will
185
# contain a <link> tag referring to it.  The value of this option must be the
186
# base URL from which the finished HTML is served.
187
#html_use_opensearch = ''
188
189
# This is the file name suffix for HTML files (e.g. ".xhtml").
190
#html_file_suffix = None
191
192
# Output file base name for HTML help builder.
193
htmlhelp_basename = 'ODDTdoc'
194
195
196
# -- Options for LaTeX output ---------------------------------------------
197
198
latex_elements = {
199
# The paper size ('letterpaper' or 'a4paper').
200
#'papersize': 'letterpaper',
201
202
# The font size ('10pt', '11pt' or '12pt').
203
#'pointsize': '10pt',
204
205
# Additional stuff for the LaTeX preamble.
206
#'preamble': '',
207
}
208
209
# Grouping the document tree into LaTeX files. List of tuples
210
# (source start file, target name, title,
211
#  author, documentclass [howto, manual, or own class]).
212
latex_documents = [
213
  ('index', 'ODDT.tex', u'ODDT Documentation',
214
   u'Maciej Wojcikowski', 'manual'),
215
]
216
217
# The name of an image file (relative to this directory) to place at the top of
218
# the title page.
219
#latex_logo = None
220
221
# For "manual" documents, if this is true, then toplevel headings are parts,
222
# not chapters.
223
#latex_use_parts = False
224
225
# If true, show page references after internal links.
226
#latex_show_pagerefs = False
227
228
# If true, show URL addresses after external links.
229
#latex_show_urls = False
230
231
# Documents to append as an appendix to all manuals.
232
#latex_appendices = []
233
234
# If false, no module index is generated.
235
#latex_domain_indices = True
236
237
238
# -- Options for manual page output ---------------------------------------
239
240
# One entry per manual page. List of tuples
241
# (source start file, name, description, authors, manual section).
242
man_pages = [
243
    ('index', 'Open Drug Discovery Toolkit', u'ODDT Documentation',
244
     [u'Maciej Wojcikowski'], 1)
245
]
246
247
# If true, show URL addresses after external links.
248
#man_show_urls = False
249
250
251
# -- Options for Texinfo output -------------------------------------------
252
253
# Grouping the document tree into Texinfo files. List of tuples
254
# (source start file, target name, title, author,
255
#  dir menu entry, description, category)
256
texinfo_documents = [
257
  ('index', 'Open Drug Discovery Toolkit', u'ODDT Documentation',
258
   u'Maciej Wojcikowski', 'Open Drug Discovery Toolkit', 'One line description of project.',
259
   'Miscellaneous'),
260
]
261
262
# Documents to append as an appendix to all manuals.
263
#texinfo_appendices = []
264
265
# If false, no module index is generated.
266
#texinfo_domain_indices = True
267
268
# How to display URL addresses: 'footnote', 'no', or 'inline'.
269
#texinfo_show_urls = 'footnote'
270
271
# If true, do not generate a @detailmenu in the "Top" node's menu.
272
#texinfo_no_detailmenu = False
273
274
275
# -- Options for Epub output ----------------------------------------------
276
277
# Bibliographic Dublin Core info.
278
epub_title = u'Open Drug Discovery Toolkit'
279
epub_author = u'Maciej Wojcikowski'
280
epub_publisher = u'Maciej Wojcikowski'
281
epub_copyright = u'2015, Maciej Wojcikowski'
282
283
# The basename for the epub file. It defaults to the project name.
284
#epub_basename = u'Open Drug Discovery Toolkit'
285
286
# The HTML theme for the epub output. Since the default themes are not optimized
287
# for small screen space, using the same theme for HTML and epub output is
288
# usually not wise. This defaults to 'epub', a theme designed to save visual
289
# space.
290
#epub_theme = 'epub'
291
292
# The language of the text. It defaults to the language option
293
# or en if the language is not set.
294
#epub_language = ''
295
296
# The scheme of the identifier. Typical schemes are ISBN or URL.
297
#epub_scheme = ''
298
299
# The unique identifier of the text. This can be a ISBN number
300
# or the project homepage.
301
#epub_identifier = ''
302
303
# A unique identification for the text.
304
#epub_uid = ''
305
306
# A tuple containing the cover image and cover page html template filenames.
307
#epub_cover = ()
308
309
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
310
#epub_guide = ()
311
312
# HTML files that should be inserted before the pages created by sphinx.
313
# The format is a list of tuples containing the path and title.
314
#epub_pre_files = []
315
316
# HTML files shat should be inserted after the pages created by sphinx.
317
# The format is a list of tuples containing the path and title.
318
#epub_post_files = []
319
320
# A list of files that should not be packed into the epub file.
321
epub_exclude_files = ['search.html']
322
323
# The depth of the table of contents in toc.ncx.
324
#epub_tocdepth = 3
325
326
# Allow duplicate toc entries.
327
#epub_tocdup = True
328
329
# Choose between 'default' and 'includehidden'.
330
#epub_tocscope = 'default'
331
332
# Fix unsupported image types using the PIL.
333
#epub_fix_images = False
334
335
# Scale large images.
336
#epub_max_image_width = 0
337
338
# How to display URL addresses: 'footnote', 'no', or 'inline'.
339
#epub_show_urls = 'inline'
340
341
# If false, no index is generated.
342
#epub_use_index = True
343
344
345
# Example configuration for intersphinx: refer to the Python standard library.
346
intersphinx_mapping = {}
347
intersphinx_mapping['sklearn'] = ('http://scikit-learn.org/stable', None)
348
intersphinx_mapping['numpy'] = ('http://docs.scipy.org/doc/numpy/', None)
349
intersphinx_mapping['scipy'] = ('http://docs.scipy.org/doc/scipy/reference/', None)
350
351
# Ignore some modules during documentation building on readthedocs.org
352
if os.environ.get('READTHEDOCS', None) == 'True':
353
    # Invoke sphinx-apidoc
354
    os.system("sphinx-apidoc -f -o rst/ ../oddt")
355
356
    try:
357
        from unittest.mock import patch, MagicMock # Python 3.3
358
    except ImportError:
359
        from mock import patch, MagicMock
360
361
    pybel = MagicMock()
362
    openbabel = MagicMock()
363
    rdkit = MagicMock()
364
    modules = {
365
                # OpenBabel
366
                'pybel': pybel,
367
                'openbabel' : openbabel,
368
369
                # RDK
370
                'rdkit': rdkit,
371
                'rdkit.Chem': rdkit.Chem,
372
                'rdkit.DataStructs': rdkit.DataStructs,
373
                'rdkit.Chem.MACCSkeys': rdkit.Chem.MACCSkeys,
374
                'rdkit.Chem.AtomPairs': rdkit.Chem.AtomPairs,
375
                'rdkit.Chem.AtomPairs.Pairs': rdkit.Chem.AtomPairs.Pairs,
376
                'rdkit.Chem.AtomPairs.Torsions': rdkit.Chem.AtomPairs.Torsions,
377
                'rdkit.Chem.Lipinski': rdkit.Chem.Lipinski,
378
                'rdkit.Chem.AllChem': rdkit.Chem.AllChem,
379
                'rdkit.Chem.Pharm2D': rdkit.Chem.Pharm2D,
380
            }
381
382
    p = patch.dict('sys.modules', modules)
383
    p.start()