-
-
Notifications
You must be signed in to change notification settings - Fork 231
/
conf.py
218 lines (181 loc) · 7.79 KB
/
conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# GemPy documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 4 10:28:52 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import datetime
import os
import sys
import warnings
import sphinx_gallery
from sphinx_gallery.sorting import FileNameSortKey
import gempy
import pyvista
import numpy as np
# region PyVista Configuration
pyvista.set_error_output_file('errors.txt')
pyvista.OFF_SCREEN = True # Not necessary - simply an insurance policy. Ensure that offscreen rendering is used for docs generation
pyvista.set_plot_theme('document') # Preferred plotting style for documentation
# pyvista.rcParams['window_size'] = np.array([1024, 768]) * 2
pyvista.FIGURE_PATH = os.path.join(os.path.abspath('_images/'), 'auto-generated/') # Save figures in specified directory
pyvista.BUILDING_GALLERY = True
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)
sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'sphinx_gallery.gen_gallery',
]
if run_intersphinx := False: # Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'numpy' : ('https://numpy.org/doc/stable/', None),
'python' : ('https://docs.python.org/{.major}'.format(sys.version_info), None),
'matplotlib': ('https://matplotlib.org/stable/', None),
'mayavi' : ('http://docs.enthought.com/mayavi/mayavi', None),
'sklearn' : ('https://scikit-learn.org/stable', None),
'skimage' : ('https://scikit-image.org/docs/dev/', None),
'pyvista' : ('https://docs.pyvista.org/', None),
'sphinx' : ('https://www.sphinx-doc.org/en/master/', None),
'pandas' : ('https://pandas.pydata.org/pandas-docs/stable/', None),
}
napoleon_google_docstring = True
autodoc_default_options = {
'autodoc_default_flags': ['members'],
'members' : None,
'member-order' : 'bysource',
'special-members' : '__init__',
'undoc-members' : True,
'exclude-members' : '__weakref__'
}
autosummary_generate = True
autosummary_imported_members = True
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst']
# The master toctree document.
master_doc = 'index'
# region General information about the project.
project = 'GemPy'
year = datetime.date.today().year
copyright = u'2017-{}, Gempy Developers'.format(year)
with open(os.path.join(os.path.dirname(__file__), '../../AUTHORS.rst'), 'r') as f:
author = f.read()
version = gempy.__version__ # The short X.Y version.
release = gempy.__version__ # The full version, including alpha/beta/rc tags.
today_fmt = '%d %B %Y'
language = 'en'
# endregion
# region building the documentation configuration
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', '**.ipynb_checkpoints', 'Thumbs.db', '.DS_Store', 'errors.txt', '../test' ]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
highlight_language = 'python3'
todo_include_todos = True # If true, `todo` and `todoList` produce output, else they produce nothing.
linkcheck_retries = 3
linkcheck_timeout = 500
# * -- Sphinx Gallery Options
sphinx_gallery_conf = {
# path to your examples scripts
"examples_dirs" : [
"../../examples/tutorials",
"../../examples/examples",
# "../../examples/integrations",
],
# path where to save gallery generated examples
"gallery_dirs" : [
'tutorials',
"examples",
# 'integrations'
],
"filename_pattern": r"\.py",
"download_all_examples" : False, # Remove the "Download all examples" button from the top level gallery
"within_subsection_order": FileNameSortKey, # Sort gallery example by file name instead of number of lines (default)
"backreferences_dir" : 'gen_modules/backreferences', # directory where function granular galleries are stored
"doc_module" : ("gempy", "gempy_viewer", 'numpy', 'pandas', 'matplotlib'), # Modules for which function level galleries are created. In
"image_scrapers" : ('pyvista', 'matplotlib'),
'first_notebook_cell' : ("%matplotlib inline\n"
"from pyvista import set_plot_theme\n"
"set_plot_theme('document')"),
'reference_url' : {
'gempy': None, # The module you locally document uses None
'numpy': 'https://numpy.org/doc/stable/'
},
}
# endregion
# region -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme_options = {
'github_user' : 'gempy-project',
'github_repo' : 'gempy',
'github_type' : 'star',
'logo' : 'logos/gempy.png',
'logo_name' : False,
'travis_button' : False,
'page_width' : '1200px',
'fixed_sidebar' : False,
'show_related' : True,
'sidebar_collapse': True,
}
# Custom sidebar templates, maps document names to template names.
# html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html']}
html_sidebars = {'**': ['about.html', 'navigation.html',
'relations.html',
'searchbox.html',
'donate.html', ]}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_favicon = '_static/logos/favicon.ico'
# endregion
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'GemPydoc'
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, 'gempy', 'GemPy Documentation', [author], 1)]
# region other options
# Remove matplotlib agg warnings from generated doc when using plt.show
warnings.filterwarnings("ignore", category=UserWarning,
message='Matplotlib is currently using agg, which is a'
' non-GUI backend, so cannot show the figure.')
# endregion