Skip to content

Commit c545b62

Browse files
committed
Workaround (possibly temporary) for docs build problem. NB can also use autodoc_suppress_warnings=['index'].
1 parent ad47d30 commit c545b62

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

docs/src/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ def _dotv(version):
217217
autopackage_name = ["iris"]
218218
autoclass_content = "both"
219219
modindex_common_prefix = ["iris"]
220+
# autodoc_suppress_warnings = ["index"]
220221

221222
# -- apidoc extension ---------------------------------------------------------
222223
# See https://github.com/sphinx-contrib/apidoc

lib/iris/experimental/ugrid.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,31 @@
2828

2929
from .._deprecation import warn_deprecated
3030
from ..ugrid.load import PARSE_UGRID_ON_LOAD, load_mesh, load_meshes
31-
from ..ugrid.mesh import Connectivity, Mesh, MeshCoord
31+
from ..ugrid.mesh import Connectivity as _ConnectivityClass
32+
from ..ugrid.mesh import Mesh as _MeshClass
33+
from ..ugrid.mesh import MeshCoord as _MeshCoordClass
3234
from ..ugrid.save import save_mesh
3335
from ..ugrid.utils import recombine_submeshes
3436

37+
38+
# Generate own duplicate definitions of the duplicated classes,
39+
# purely because this prevents Sphinx from complaining about duplicate index items.
40+
# (e.g. "WARNING: duplicate object description of iris.ugrid.mesh.Mesh, other instance
41+
# in generated/api/iris.experimental.ugrid, use :no-index: for one of them"
42+
# )
43+
# For some reason, this only happens for classes, and not functions.
44+
class Connectivity(_ConnectivityClass):
45+
pass
46+
47+
48+
class Mesh(_MeshClass):
49+
pass
50+
51+
52+
class MeshCoord(_MeshCoordClass):
53+
pass
54+
55+
3556
__all__ = [
3657
"Connectivity",
3758
"Mesh",

0 commit comments

Comments
 (0)