source: trunk/docs/source/conf.py @ 2805

Last change on this file since 2805 was 2805, checked in by toby, 7 years ago

change docs to list the version number

  • Property svn:eol-style set to native
File size: 11.6 KB
Line 
1# -*- coding: utf-8 -*-
2#
3# sphinx documentation build configuration file based on one built by sphinx-quickstart
4#
5# This file is execfile()d with the current directory set to its containing dir.
6#
7# Note that not all possible configuration values are present in this
8# autogenerated file.
9#
10# All configuration values have a default; values that are commented out
11# serve to show the default.
12
13import sys, os
14# set up dummy packages for misc imports not on readthedocs
15from mock import Mock as MagicMock
16class wx(MagicMock):
17    #@classmethod
18    #def __getattr__(cls, name):
19    #    return wx()
20    Menu = Panel = Dialog = CheckBox = Choice = ComboBox = object
21    Button = PyValidator = TextCtrl = TreeCtrl = object
22    DEFAULT_DIALOG_STYLE = RESIZE_BORDER = CENTRE = OK = CANCEL = True
23    ID_ANY = -1
24    def __getitem__(self,*args):
25        return '3.0.0'
26    class grid(object):
27        PyGridTableBase = PyGridCellEditor = Grid = object
28    class html(object):
29        HtmlWindow = object
30    class aui(MagicMock):
31        AuiNotebook = HtmlWindow = object
32    class lib(MagicMock):
33        class scrolledpanel(MagicMock):
34            ScrolledPanel = object
35        class gridmovers(MagicMock): pass
36        class colourselect(MagicMock): pass
37        class resizewidget(MagicMock): pass
38        class mixins(MagicMock):
39            class listctrl(MagicMock):
40                ListCtrlAutoWidthMixin = object
41                TextEditMixin = object
42
43sys.modules.update({'wx':wx(),
44    'wx.aui':wx.aui(),
45    'wx.html':wx.html(),
46        'wx.grid':wx.grid(),
47        'wx.lib':wx.lib(),
48        'wx.wizard':wx.grid(),
49        'wx.glcanvas':wx.lib(),
50        'wx.lib.scrolledpanel':wx.lib.scrolledpanel(),
51        'wx.lib.gridmovers':wx.lib.gridmovers(),
52        'wx.lib.colourselect':wx.lib.gridmovers(),
53        'wx.lib.resizewidget':wx.lib.resizewidget(),
54        'wx.lib.mixins':wx.lib.mixins(),
55        'wx.lib.mixins.listctrl':wx.lib.mixins.listctrl()})
56wx.aui.AUI_NB_TOP = 0
57wx.aui.AUI_NB_SCROLL_BUTTONS = 0
58
59class numpy(MagicMock):
60    pi = 3.0
61    def log(self,*args): return 0
62    def sqrt(self,*args): return 1
63    class ma(MagicMock):pass
64    class linalg(MagicMock):pass
65sys.modules.update({'numpy':numpy()})
66sys.modules.update({'numpy.ma':numpy.ma()})
67sys.modules.update({'numpy.linalg':numpy.linalg()})
68sys.modules.update({'numpy.fft':numpy.linalg()})
69
70class scipy(MagicMock):
71    class optimize(MagicMock):pass
72sys.modules.update({'scipy':scipy()})
73sys.modules.update({'scipy.optimize':scipy.optimize()})
74sys.modules.update({'scipy.stats':scipy.optimize()})
75sys.modules.update({'scipy.interpolate':scipy.optimize()})
76sys.modules.update({'scipy.special':scipy.optimize()})
77sys.modules.update({'scipy.misc':scipy.optimize()})
78sys.modules.update({'scipy.signal':scipy.optimize()})
79sys.modules.update({'scipy.cluster':scipy.optimize()})
80sys.modules.update({'scipy.cluster.vq':scipy.optimize()})
81
82class OpenGL(MagicMock):
83    class GL(MagicMock):pass
84    class GLU(MagicMock):pass
85sys.modules.update({'OpenGL':OpenGL()})
86sys.modules.update({'OpenGL.GL':OpenGL.GL()})
87sys.modules.update({'OpenGL.GLU':OpenGL.GLU()})
88sys.modules.update({'OpenGL.GLE':OpenGL.GL()})
89
90class Mock(MagicMock):
91    @classmethod
92    def __getattr__(cls, name):
93        return Mock()
94
95MOCK_MODULES = [
96                'pypowder', 'pyspg', 'pytexture', 'polymask', 'fellipse',
97                'matplotlib', 'matplotlib.backends', 'matplotlib.backends.backend_wx',
98                'matplotlib.colors',
99                'matplotlib.backends.backend_wxagg','pylab','matplotlib.collections',
100                'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.mplot3d.axes3d',
101                'winreg','unpack_cbf','h5py'
102                ]
103sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
104
105
106# If extensions (or modules to document with autodoc) are in another directory,
107# add these directories to sys.path here. If the directory is relative to the
108# documentation root, use os.path.abspath to make it absolute, like shown here.
109#sys.path.insert(0, os.path.abspath('.'))
110sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))
111sys.path.insert(1, os.path.abspath(os.path.join('..', '..','exports')))
112sys.path.insert(1, os.path.abspath(os.path.join('..', '..','imports')))
113#print(sys.path)
114import glob
115for fil in glob.glob(os.path.abspath(os.path.join('..', '..','*.py'))):
116    pkg = os.path.splitext(os.path.split(fil)[1])[0]
117    exec('import '+pkg)
118import GSASIIpath
119version = GSASIIpath.GetVersionNumber()
120print('Found highest version as {}'.format(version))
121# -- General configuration -----------------------------------------------------
122
123# If your documentation needs a minimal Sphinx version, state it here.
124#needs_sphinx = '1.0'
125
126# Add any Sphinx extension module names here, as strings. They can be extensions
127# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
128extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.mathjax']
129
130# Add any paths that contain templates here, relative to this directory.
131templates_path = ['_templates']
132
133# The suffix of source filenames.
134source_suffix = '.rst'
135
136# The encoding of source files.
137#source_encoding = 'utf-8-sig'
138
139# The master toctree document.
140master_doc = 'index'
141
142# General information about the project.
143project = u'GSAS-II'
144copyright = u'2013-2017, Von Dreele and Toby for Argonne National Laboratory'
145
146# The version info for the project you're documenting, acts as replacement for
147# |version| and |release|, also used in various other places throughout the
148# built documents.
149#
150# The short X.Y version.
151version = '{}'.format(version)
152# The full version, including alpha/beta/rc tags.
153release = 'version {}'.format(version)
154
155# The language for content autogenerated by Sphinx. Refer to documentation
156# for a list of supported languages.
157#language = None
158
159# There are two options for replacing |today|: either, you set today to some
160# non-false value, then it is used:
161#today = ''
162# Else, today_fmt is used as the format for a strftime call.
163#today_fmt = '%B %d, %Y'
164
165# List of patterns, relative to source directory, that match files and
166# directories to ignore when looking for source files.
167exclude_patterns = []
168
169# The reST default role (used for this markup: `text`) to use for all documents.
170#default_role = None
171
172# If true, '()' will be appended to :func: etc. cross-reference text.
173#add_function_parentheses = True
174
175# If true, the current module name will be prepended to all description
176# unit titles (such as .. function::).
177#add_module_names = True
178
179# If true, sectionauthor and moduleauthor directives will be shown in the
180# output. They are ignored by default.
181#show_authors = False
182
183# The name of the Pygments (syntax highlighting) style to use.
184pygments_style = 'sphinx'
185
186# A list of ignored prefixes for module index sorting.
187#modindex_common_prefix = []
188
189
190# -- Options for HTML output ---------------------------------------------------
191
192# The theme to use for HTML and HTML Help pages.  See the documentation for
193# a list of builtin themes.
194html_theme = 'default'
195#html_theme = 'agogo'
196#html_theme = 'sphinxdoc'
197
198# Theme options are theme-specific and customize the look and feel of a theme
199# further.  For a list of options available for each theme, see the
200# documentation.
201#html_theme_options = {}
202
203# Add any paths that contain custom themes here, relative to this directory.
204#html_theme_path = []
205
206# The name for this set of Sphinx documents.  If None, it defaults to
207# "<project> v<release> documentation".
208#html_title = None
209
210# A shorter title for the navigation bar.  Default is the same as html_title.
211#html_short_title = None
212
213# The name of an image file (relative to this directory) to place at the top
214# of the sidebar.
215html_logo = 'G2_html_logo.png'
216
217# The name of an image file (within the static path) to use as favicon of the
218# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
219# pixels large.
220#html_favicon = None
221
222# Add any paths that contain custom static files (such as style sheets) here,
223# relative to this directory. They are copied after the builtin static files,
224# so a file named "default.css" will overwrite the builtin "default.css".
225html_static_path = ['_static']
226
227# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
228# using the given strftime format.
229#html_last_updated_fmt = '%b %d, %Y'
230
231# If true, SmartyPants will be used to convert quotes and dashes to
232# typographically correct entities.
233#html_use_smartypants = True
234
235# Custom sidebar templates, maps document names to template names.
236#html_sidebars = {}
237
238# Additional templates that should be rendered to pages, maps page names to
239# template names.
240#html_additional_pages = {}
241
242# If false, no module index is generated.
243#html_domain_indices = True
244
245# If false, no index is generated.
246#html_use_index = True
247
248# If true, the index is split into individual pages for each letter.
249#html_split_index = False
250
251# If true, links to the reST sources are added to the pages.
252#html_show_sourcelink = True
253
254# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
255#html_show_sphinx = True
256
257# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
258#html_show_copyright = True
259
260# If true, an OpenSearch description file will be output, and all pages will
261# contain a <link> tag referring to it.  The value of this option must be the
262# base URL from which the finished HTML is served.
263#html_use_opensearch = ''
264
265# This is the file name suffix for HTML files (e.g. ".xhtml").
266#html_file_suffix = None
267
268# Output file base name for HTML help builder.
269htmlhelp_basename = 'GSASIIdoc'
270
271
272# -- Options for LaTeX output --------------------------------------------------
273
274latex_elements = {
275# The paper size ('letterpaper' or 'a4paper').
276#'papersize': 'letterpaper',
277
278# The font size ('10pt', '11pt' or '12pt').
279#'pointsize': '10pt',
280
281# Additional stuff for the LaTeX preamble.
282#'preamble': '',
283}
284
285# Grouping the document tree into LaTeX files. List of tuples
286# (source start file, target name, title, author, documentclass [howto/manual]).
287latex_documents = [
288  ('index', 'GSASIIdoc.tex', u'GSAS-II Developers Documentation',
289   u'Robert B. Von Dreele and Brian H. Toby', 'manual'),
290]
291
292# The name of an image file (relative to this directory) to place at the top of
293# the title page.
294latex_logo = 'G2_html_logo.png'
295
296# For "manual" documents, if this is true, then toplevel headings are parts,
297# not chapters.
298#latex_use_parts = False
299
300# If true, show page references after internal links.
301#latex_show_pagerefs = False
302
303# If true, show URL addresses after external links.
304#latex_show_urls = False
305
306# Documents to append as an appendix to all manuals.
307#latex_appendices = []
308
309# If false, no module index is generated.
310#latex_domain_indices = True
311
312
313# -- Options for manual page output --------------------------------------------
314
315# One entry per manual page. List of tuples
316# (source start file, name, description, authors, manual section).
317man_pages = [
318    ('index', 'GSASIIdoc', u'GSAS-II Developers Documentation',
319     [u'Robert B. Von Dreele',u'Brian H. Toby'], 1)
320]
321
322# If true, show URL addresses after external links.
323#man_show_urls = False
324
325
326# -- Options for Texinfo output ------------------------------------------------
327
328# Grouping the document tree into Texinfo files. List of tuples
329# (source start file, target name, title, author,
330#  dir menu entry, description, category)
331texinfo_documents = [
332    ('index', 'GSASIIdoc', u'GSAS-II Developers Documentation',
333   u'Robert B. Von Dreele and Brian H. Toby', 'GSASIIdoc', 'GSAS-II Developers Manual',
334   'Miscellaneous'),
335]
336
337# Documents to append as an appendix to all manuals.
338#texinfo_appendices = []
339
340# If false, no module index is generated.
341#texinfo_domain_indices = True
342
343# How to display URL addresses: 'footnote', 'no', or 'inline'.
344#texinfo_show_urls = 'footnote'
Note: See TracBrowser for help on using the repository browser.