File: conf.py

package info (click to toggle)
pytorch-geometric 2.6.1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,904 kB
  • sloc: python: 127,155; sh: 338; cpp: 27; makefile: 18; javascript: 16
file content (82 lines) | stat: -rw-r--r-- 2,501 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
import datetime
import os.path as osp
import sys

import pyg_sphinx_theme

import torch_geometric

author = 'PyG Team'
project = 'pytorch_geometric'
version = torch_geometric.__version__
copyright = f'{datetime.datetime.now().year}, {author}'

sys.path.append(osp.join(osp.dirname(pyg_sphinx_theme.__file__), 'extension'))

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.intersphinx',
    'sphinx.ext.mathjax',
    'sphinx.ext.napoleon',
    'sphinx.ext.viewcode',
    'sphinx_copybutton',
    'nbsphinx',
    'pyg',
]

html_theme = 'pyg_sphinx_theme'
html_logo = ('https://raw.githubusercontent.com/pyg-team/pyg_sphinx_theme/'
             'master/pyg_sphinx_theme/static/img/pyg_logo.png')
html_favicon = ('https://raw.githubusercontent.com/pyg-team/pyg_sphinx_theme/'
                'master/pyg_sphinx_theme/static/img/favicon.png')
html_static_path = ['_static']
templates_path = ['_templates']

add_module_names = False
autodoc_member_order = 'bysource'

suppress_warnings = ['autodoc.import_object']

intersphinx_mapping = {
    'python': ('https://docs.python.org/', None),
    # 'numpy': ('http://docs.scipy.org/doc/numpy', None),
    'pandas': ('http://pandas.pydata.org/pandas-docs/dev', None),
    'torch': ('https://pytorch.org/docs/master', None),
}

nbsphinx_thumbnails = {
    'tutorial/create_gnn':
    '_static/thumbnails/create_gnn.png',
    'tutorial/heterogeneous':
    '_static/thumbnails/heterogeneous.png',
    'tutorial/create_dataset':
    '_static/thumbnails/create_dataset.png',
    'tutorial/load_csv':
    '_static/thumbnails/load_csv.png',
    'tutorial/neighbor_loader':
    '_static/thumbnails/neighbor_loader.png',
    'tutorial/point_cloud':
    '_static/thumbnails/point_cloud.png',
    'tutorial/explain':
    '_static/thumbnails/explain.png',
    'tutorial/shallow_node_embeddings':
    '_static/thumbnails/shallow_node_embeddings.png',
    'tutorial/distributed_pyg':
    '_static/thumbnails/distributed_pyg.png',
    'tutorial/multi_gpu_vanilla':
    '_static/thumbnails/multi_gpu_vanilla.png',
    'tutorial/multi_node_multi_gpu_vanilla':
    '_static/thumbnails/multi_gpu_vanilla.png',
}


def rst_jinja_render(app, _, source):
    if hasattr(app.builder, 'templates'):
        rst_context = {'torch_geometric': torch_geometric}
        source[0] = app.builder.templates.render_string(source[0], rst_context)


def setup(app):
    app.connect('source-read', rst_jinja_render)
    app.add_js_file('js/version_alert.js')