File size: 4,603 Bytes
a550c4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import os
import sys

# -- Path setup --------------------------------------------------------------
sys.path.insert(0, os.path.abspath("../.."))

# -- Project information -----------------------------------------------------

project = "Kimodo"
copyright = "2026, NVIDIA"
author = "NVIDIA"

version = ""
release = ""

# -- General configuration ---------------------------------------------------

extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.napoleon",
    "sphinx.ext.viewcode",
    "sphinx.ext.intersphinx",
    "sphinx.ext.autosummary",
    "sphinx.ext.githubpages",
    "sphinx_copybutton",
    "myst_parser",
    "sphinx_design",
]

napoleon_google_docstring = True
napoleon_numpy_docstring = False
napoleon_include_init_with_doc = True
napoleon_use_param = True
napoleon_use_rtype = True

autodoc_default_options = {
    "members": True,
    "member-order": "bysource",
    "special-members": "__init__",
    "undoc-members": True,
    "exclude-members": "__weakref__",
    "show-inheritance": False,
}
autodoc_typehints = "none"

autosummary_generate = True

# Avoid initialization issues for optional native libs
os.environ.setdefault("MUJOCO_GL", "osmesa")
os.environ.setdefault("PYOPENGL_PLATFORM", "osmesa")


class Mock:
    """Mock class for imports that can't be satisfied."""

    def __init__(self, *args, **kwargs):
        pass

    def __call__(self, *args, **kwargs):
        return Mock()

    def __getattr__(self, name):
        if name in ("__file__", "__path__"):
            return "/dev/null"
        if name == "__version__":
            # Some libraries (e.g. safetensors) parse torch.__version__ with
            # packaging.version.Version, so this must be a valid PEP 440 string.
            return "0.0.0"
        if name == "__signature__":
            return None
        if name == "__mro_entries__":
            return lambda bases: ()
        return Mock()

    def __getitem__(self, name):
        return Mock()

    def __iter__(self):
        return iter([])

    def __or__(self, other):
        return Mock()

    def __ror__(self, other):
        return Mock()


mock_modules = [
    "torch",
    "torch.nn",
    "torch.nn.functional",
    "torch.optim",
    "torch.distributed",
    "torch.cuda",
    "torch.utils",
    "torch.utils.data",
    "lightning",
    "lightning.fabric",
    "lightning_fabric",
    "pytorch_lightning",
    "tensordict",
    "pydantic",
    "pydantic.dataclasses",
    "pydantic_core",
    "mujoco",
    "isaacgym",
    "isaacgymenvs",
    "genesis",
    "omni",
    "wandb",
    "hydra",
    "omegaconf",
    "tqdm",
    "trimesh",
    "pyvista",
    "smplx",
    "smpl",
    "scipy",
    "scipy.spatial",
    "scipy.spatial.transform",
    "peft",
    "transformers",
    "safetensors",
    "safetensors.torch",
    "sklearn",
    "PIL",
    "cv2",
    "rich",
    "rich.progress",
    "skimage",
    "imageio",
    "openmesh",
    "gym",
    "easydict",
    "dm_control",
    "dm_control.mjcf",
    "dm_control.mujoco",
    "matplotlib",
    "matplotlib.pyplot",
]

for mod in mock_modules:
    sys.modules[mod] = Mock()

autodoc_mock_imports = mock_modules

templates_path = ["_templates"]
exclude_patterns = ["api_reference/_generated/**"]

language = "en"

source_suffix = {
    ".rst": "restructuredtext",
    ".md": "markdown",
}

master_doc = "index"

# -- Options for HTML output -------------------------------------------------

html_theme = "nvidia_sphinx_theme"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
html_logo = "_static/logo-placeholder.svg"
html_show_sourcelink = False

html_theme_options = {
    "collapse_navigation": False,
    "navigation_depth": 4,
}

toc_object_entries_show_parents = "hide"

htmlhelp_basename = "Kimododoc"

# -- Options for intersphinx -------------------------------------------------

intersphinx_mapping = {
    "python": ("https://docs.python.org/3", None),
    "torch": ("https://pytorch.org/docs/stable/", None),
    "numpy": ("https://numpy.org/doc/stable/", None),
}

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

# Generate heading anchors so cross-doc links like path.md#fragment resolve (local ids).
myst_heading_anchors = 4

# Required so `:::{dropdown}` and other fenced directives in .md files are parsed (not shown as plain text).
myst_enable_extensions = ["colon_fence"]


def setup(app):
    app.add_css_file("custom.css")