conf.py 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. # -*- coding: utf-8 -*-
  2. #
  3. # This file is execfile()d with the current directory set to its containing dir.
  4. #
  5. # Note that not all possible configuration values are present in this
  6. # autogenerated file.
  7. #
  8. # All configuration values have a default; values that are commented out
  9. # serve to show the default.
  10. import os
  11. import sys
  12. import inspect
  13. import shutil
  14. __location__ = os.path.join(os.getcwd(), os.path.dirname(
  15. inspect.getfile(inspect.currentframe())))
  16. # If extensions (or modules to document with autodoc) are in another directory,
  17. # add these directories to sys.path here. If the directory is relative to the
  18. # documentation root, use os.path.abspath to make it absolute, like shown here.
  19. sys.path.insert(0, os.path.join(__location__, '../src'))
  20. # -- Run sphinx-apidoc ------------------------------------------------------
  21. # This hack is necessary since RTD does not issue `sphinx-apidoc` before running
  22. # `sphinx-build -b html . _build/html`. See Issue:
  23. # https://github.com/rtfd/readthedocs.org/issues/1139
  24. # DON'T FORGET: Check the box "Install your project inside a virtualenv using
  25. # setup.py install" in the RTD Advanced Settings.
  26. # Additionally it helps us to avoid running apidoc manually
  27. try: # for Sphinx >= 1.7
  28. from sphinx.ext import apidoc
  29. except ImportError:
  30. from sphinx import apidoc
  31. output_dir = os.path.join(__location__, "api")
  32. module_dir = os.path.join(__location__, "../src/hanna_rechnet")
  33. try:
  34. shutil.rmtree(output_dir)
  35. except FileNotFoundError:
  36. pass
  37. try:
  38. import sphinx
  39. from pkg_resources import parse_version
  40. cmd_line_template = "sphinx-apidoc -f -o {outputdir} {moduledir}"
  41. cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir)
  42. args = cmd_line.split(" ")
  43. if parse_version(sphinx.__version__) >= parse_version('1.7'):
  44. args = args[1:]
  45. apidoc.main(args)
  46. except Exception as e:
  47. print("Running `sphinx-apidoc` failed!\n{}".format(e))
  48. # -- General configuration -----------------------------------------------------
  49. # If your documentation needs a minimal Sphinx version, state it here.
  50. # needs_sphinx = '1.0'
  51. # Add any Sphinx extension module names here, as strings. They can be extensions
  52. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  53. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
  54. 'sphinx.ext.autosummary', 'sphinx.ext.viewcode', 'sphinx.ext.coverage',
  55. 'sphinx.ext.doctest', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
  56. 'sphinx.ext.napoleon']
  57. # Add any paths that contain templates here, relative to this directory.
  58. templates_path = ['_templates']
  59. # The suffix of source filenames.
  60. source_suffix = '.rst'
  61. # The encoding of source files.
  62. # source_encoding = 'utf-8-sig'
  63. # The master toctree document.
  64. master_doc = 'index'
  65. # General information about the project.
  66. project = u'hanna_rechnet'
  67. copyright = u'2019, Thomas Verchow'
  68. # The version info for the project you're documenting, acts as replacement for
  69. # |version| and |release|, also used in various other places throughout the
  70. # built documents.
  71. #
  72. # The short X.Y version.
  73. version = '' # Is set by calling `setup.py docs`
  74. # The full version, including alpha/beta/rc tags.
  75. release = '' # Is set by calling `setup.py docs`
  76. # The language for content autogenerated by Sphinx. Refer to documentation
  77. # for a list of supported languages.
  78. # language = None
  79. # There are two options for replacing |today|: either, you set today to some
  80. # non-false value, then it is used:
  81. # today = ''
  82. # Else, today_fmt is used as the format for a strftime call.
  83. # today_fmt = '%B %d, %Y'
  84. # List of patterns, relative to source directory, that match files and
  85. # directories to ignore when looking for source files.
  86. exclude_patterns = ['_build']
  87. # The reST default role (used for this markup: `text`) to use for all documents.
  88. # default_role = None
  89. # If true, '()' will be appended to :func: etc. cross-reference text.
  90. # add_function_parentheses = True
  91. # If true, the current module name will be prepended to all description
  92. # unit titles (such as .. function::).
  93. # add_module_names = True
  94. # If true, sectionauthor and moduleauthor directives will be shown in the
  95. # output. They are ignored by default.
  96. # show_authors = False
  97. # The name of the Pygments (syntax highlighting) style to use.
  98. pygments_style = 'sphinx'
  99. # A list of ignored prefixes for module index sorting.
  100. # modindex_common_prefix = []
  101. # If true, keep warnings as "system message" paragraphs in the built documents.
  102. # keep_warnings = False
  103. # -- Options for HTML output ---------------------------------------------------
  104. # The theme to use for HTML and HTML Help pages. See the documentation for
  105. # a list of builtin themes.
  106. html_theme = 'alabaster'
  107. # Theme options are theme-specific and customize the look and feel of a theme
  108. # further. For a list of options available for each theme, see the
  109. # documentation.
  110. html_theme_options = {
  111. 'sidebar_width': '300px',
  112. 'page_width': '1200px'
  113. }
  114. # Add any paths that contain custom themes here, relative to this directory.
  115. # html_theme_path = []
  116. # The name for this set of Sphinx documents. If None, it defaults to
  117. # "<project> v<release> documentation".
  118. try:
  119. from hanna_rechnet import __version__ as version
  120. except ImportError:
  121. pass
  122. else:
  123. release = version
  124. # A shorter title for the navigation bar. Default is the same as html_title.
  125. # html_short_title = None
  126. # The name of an image file (relative to this directory) to place at the top
  127. # of the sidebar.
  128. # html_logo = ""
  129. # The name of an image file (within the static path) to use as favicon of the
  130. # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
  131. # pixels large.
  132. # html_favicon = None
  133. # Add any paths that contain custom static files (such as style sheets) here,
  134. # relative to this directory. They are copied after the builtin static files,
  135. # so a file named "default.css" will overwrite the builtin "default.css".
  136. html_static_path = ['_static']
  137. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  138. # using the given strftime format.
  139. # html_last_updated_fmt = '%b %d, %Y'
  140. # If true, SmartyPants will be used to convert quotes and dashes to
  141. # typographically correct entities.
  142. # html_use_smartypants = True
  143. # Custom sidebar templates, maps document names to template names.
  144. # html_sidebars = {}
  145. # Additional templates that should be rendered to pages, maps page names to
  146. # template names.
  147. # html_additional_pages = {}
  148. # If false, no module index is generated.
  149. # html_domain_indices = True
  150. # If false, no index is generated.
  151. # html_use_index = True
  152. # If true, the index is split into individual pages for each letter.
  153. # html_split_index = False
  154. # If true, links to the reST sources are added to the pages.
  155. # html_show_sourcelink = True
  156. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  157. # html_show_sphinx = True
  158. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  159. # html_show_copyright = True
  160. # If true, an OpenSearch description file will be output, and all pages will
  161. # contain a <link> tag referring to it. The value of this option must be the
  162. # base URL from which the finished HTML is served.
  163. # html_use_opensearch = ''
  164. # This is the file name suffix for HTML files (e.g. ".xhtml").
  165. # html_file_suffix = None
  166. # Output file base name for HTML help builder.
  167. htmlhelp_basename = 'hanna_rechnet-doc'
  168. # -- Options for LaTeX output --------------------------------------------------
  169. latex_elements = {
  170. # The paper size ('letterpaper' or 'a4paper').
  171. # 'papersize': 'letterpaper',
  172. # The font size ('10pt', '11pt' or '12pt').
  173. # 'pointsize': '10pt',
  174. # Additional stuff for the LaTeX preamble.
  175. # 'preamble': '',
  176. }
  177. # Grouping the document tree into LaTeX files. List of tuples
  178. # (source start file, target name, title, author, documentclass [howto/manual]).
  179. latex_documents = [
  180. ('index', 'user_guide.tex', u'hanna_rechnet Documentation',
  181. u'Thomas Verchow', 'manual'),
  182. ]
  183. # The name of an image file (relative to this directory) to place at the top of
  184. # the title page.
  185. # latex_logo = ""
  186. # For "manual" documents, if this is true, then toplevel headings are parts,
  187. # not chapters.
  188. # latex_use_parts = False
  189. # If true, show page references after internal links.
  190. # latex_show_pagerefs = False
  191. # If true, show URL addresses after external links.
  192. # latex_show_urls = False
  193. # Documents to append as an appendix to all manuals.
  194. # latex_appendices = []
  195. # If false, no module index is generated.
  196. # latex_domain_indices = True
  197. # -- External mapping ------------------------------------------------------------
  198. python_version = '.'.join(map(str, sys.version_info[0:2]))
  199. intersphinx_mapping = {
  200. 'sphinx': ('http://www.sphinx-doc.org/en/stable', None),
  201. 'python': ('https://docs.python.org/' + python_version, None),
  202. 'matplotlib': ('https://matplotlib.org', None),
  203. 'numpy': ('https://docs.scipy.org/doc/numpy', None),
  204. 'sklearn': ('http://scikit-learn.org/stable', None),
  205. 'pandas': ('http://pandas.pydata.org/pandas-docs/stable', None),
  206. 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
  207. }