Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't document zarr.codec submodules #2605

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import sys
from typing import Any

import sphinx
import sphinx.application

from importlib.metadata import version as get_version
Expand Down Expand Up @@ -60,6 +61,20 @@
autoapi_keep_files = True
autoapi_options = [ 'members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members', ]

def skip_submodules(
app: sphinx.application.Sphinx,
what: str,
name: str,
obj: object,
skip: bool,
options: dict[str, Any]
) -> bool:
# Skip documenting zarr.codecs submodules
# codecs are documented in the main zarr.codecs namespace
if what == "module" and name.startswith("zarr.codecs."):
skip = True
return skip

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -179,6 +194,7 @@

def setup(app: sphinx.application.Sphinx) -> None:
app.add_css_file("custom.css")
app.connect("autoapi-skip-member", skip_submodules)


# The name of an image file (relative to this directory) to use as a favicon of
Expand Down
Loading