File: conf.py

package info (click to toggle)
python-gsd 3.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,020 kB
  • sloc: python: 3,141; ansic: 2,057; cpp: 120; makefile: 16
file content (105 lines) | stat: -rw-r--r-- 2,639 bytes parent folder | download
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
#!/usr/bin/env python3
# Copyright (c) 2016-2024 The Regents of the University of Michigan
# Part of GSD, released under the BSD 2-Clause License.

import datetime
import os
import tempfile

import gsd

extensions = [
    'breathe',
    'sphinx.ext.autodoc',
    'sphinx.ext.napoleon',
    'sphinx.ext.intersphinx',
    'sphinx.ext.mathjax',
    'IPython.sphinxext.ipython_console_highlighting',
    'IPython.sphinxext.ipython_directive',
    'sphinx_copybutton',
]

#if os.getenv('READTHEDOCS'):
#    extensions.append('sphinxcontrib.googleanalytics')
#    googleanalytics_id = 'G-25TF48HJ76'

napoleon_include_special_with_doc = True

intersphinx_mapping = {
    'python': ('https://docs.python.org/3', ('/usr/share/doc/python3/html/objects.inv', None)),
    'numpy': ('https://numpy.org/doc/stable', ('/usr/share/doc/python-numpy/html/objects.inv', None)),
#    'hoomd': ('https://hoomd-blue.readthedocs.io/en/latest/', None),
}
autodoc_docstring_signature = True

mathjax_path = 'file:///usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'

templates_path = ['_templates']

source_suffix = '.rst'

master_doc = 'index'

project = 'GSD'
year = datetime.date.today().year
copyright = f'2016-{ year } The Regents of the University of Michigan'

version = gsd.version.version
release = version

exclude_patterns = ['_build']

default_role = 'any'

pygments_style = 'friendly'
pygments_dark_style = 'native'

html_theme = 'furo'
html_static_path = ['_static']
html_theme_options = {
    'navigation_with_keys': True,
    'top_of_page_buttons': [],
    'dark_css_variables': {
        'color-brand-primary': '#5187b2',
        'color-brand-content': '#5187b2',
    },
    'light_css_variables': {
        'color-brand-primary': '#406a8c',
        'color-brand-content': '#406a8c',
    },
}

copybutton_prompt_text = r'>>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: '
copybutton_prompt_is_regexp = True
copybutton_remove_prompts = True
copybutton_line_continuation_character = '\\'


### Add custom directives
def setup(app):
    app.add_object_type(
        'chunk', 'chunk', objname='Data chunk', indextemplate='single: %s (data chunk)'
    )


tmpdir = tempfile.TemporaryDirectory()

###### IPython directive settings
ipython_mplbackend = ''
ipython_execlines = [
    'import gsd.fl',
    'import gsd.hoomd',
    'import gsd.pygsd',
    'import numpy',
    'import os',
    f'os.chdir("{tmpdir.name}")',
]


dirname = os.path.abspath(os.path.dirname(__file__))
breathe_projects = {'gsd': os.path.join(dirname, '..', 'devdoc', 'xml')}
breathe_default_project = 'gsd'

breathe_domain_by_extension = {
    'h': 'c',
}