MCPcopy Create free account
hub / github.com/mpi4py/mpi4py / _patch_domain_python

Function _patch_domain_python

docs/source/conf.py:150–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148
149
150def _patch_domain_python():
151 try:
152 from numpy.typing import __all__ as numpy_types
153 except ImportError:
154 numpy_types = []
155 try:
156 from mpi4py.typing import __all__ as mpi4py_types
157 except ImportError:
158 mpi4py_types = []
159
160 numpy_types = set(numpy_types)
161 mpi4py_types = set(mpi4py_types)
162 for name in numpy_types:
163 autodoc_type_aliases[name] = f"~numpy.typing.{name}"
164 for name in mpi4py_types:
165 autodoc_type_aliases[name] = f"~mpi4py.typing.{name}"
166
167 from sphinx.domains.python import PythonDomain
168 from sphinx.util.inspect import TypeAliasForwardRef
169
170 PythonDomain.object_types["data"].roles += ("class",)
171 TypeAliasForwardRef.__repr__ = lambda self: self.name
172
173
174def _setup_autodoc(app):

Callers 1

setupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…