diff --git a/.readthedocs.yml b/.readthedocs.yml index 08a0fa94..db97ed7c 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,6 +13,7 @@ build: # Build documentation in the doc/ directory with Sphinx sphinx: configuration: docs/conf.py + fail_on_warning: true # Optionally declare the Python requirements required to build your docs conda: diff --git a/docs/conf.py b/docs/conf.py index d5312069..b3c482ec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,12 +18,18 @@ "myst_nb", "sphinx.ext.autodoc", "sphinx.ext.autosummary", + "sphinx.ext.extlinks", "sphinx_copybutton", "sphinx_togglebutton", "sphinx_design", "sphinx.ext.napoleon", ] +extlinks = { + "issue": ("https://github.com/zarr-developers/virtualizarr/issues/%s", "GH%s"), + "pull": ("https://github.com/zarr-developers/virtualizarr/pull/%s", "PR%s"), + "discussion": ("https://github.com/zarr-developers/virtualizarr/discussions/%s", "D%s"), +} # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -49,6 +55,9 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False +# -- Myst Options ------------------------------------------------- + +myst_heading_anchors = 3 # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output @@ -78,7 +87,7 @@ 'custom.css', ] -html_logo = "_static/_future_logo.png" +# html_logo = "_static/_future_logo.png" html_static_path = ["_static"] diff --git a/virtualizarr/manifests/manifest.py b/virtualizarr/manifests/manifest.py index 1933844a..38743f9b 100644 --- a/virtualizarr/manifests/manifest.py +++ b/virtualizarr/manifests/manifest.py @@ -70,12 +70,12 @@ class ChunkManifest: The manifest can be converted to or from a dictionary which looks like this - { - "0.0.0": {"path": "s3://bucket/foo.nc", "offset": 100, "length": 100}, - "0.0.1": {"path": "s3://bucket/foo.nc", "offset": 200, "length": 100}, - "0.1.0": {"path": "s3://bucket/foo.nc", "offset": 300, "length": 100}, - "0.1.1": {"path": "s3://bucket/foo.nc", "offset": 400, "length": 100}, - } + | { + | "0.0.0": {"path": "s3://bucket/foo.nc", "offset": 100, "length": 100}, + | "0.0.1": {"path": "s3://bucket/foo.nc", "offset": 200, "length": 100}, + | "0.1.0": {"path": "s3://bucket/foo.nc", "offset": 300, "length": 100}, + | "0.1.1": {"path": "s3://bucket/foo.nc", "offset": 400, "length": 100}, + | } using the .__init__() and .dict() methods, so users of this class can think of the manifest as if it were a dict mapping zarr chunk keys to byte ranges. @@ -98,12 +98,12 @@ def __init__(self, entries: dict, shape: tuple[int, ...] | None = None) -> None: entries: dict Chunk keys and byte range information, as a dictionary of the form - { - "0.0.0": {"path": "s3://bucket/foo.nc", "offset": 100, "length": 100}, - "0.0.1": {"path": "s3://bucket/foo.nc", "offset": 200, "length": 100}, - "0.1.0": {"path": "s3://bucket/foo.nc", "offset": 300, "length": 100}, - "0.1.1": {"path": "s3://bucket/foo.nc", "offset": 400, "length": 100}, - } + | { + | "0.0.0": {"path": "s3://bucket/foo.nc", "offset": 100, "length": 100}, + | "0.0.1": {"path": "s3://bucket/foo.nc", "offset": 200, "length": 100}, + | "0.1.0": {"path": "s3://bucket/foo.nc", "offset": 300, "length": 100}, + | "0.1.1": {"path": "s3://bucket/foo.nc", "offset": 400, "length": 100}, + | } """ if shape is None and not entries: raise ValueError("need a chunk grid shape if no chunks given")