Skip to content

Commit

Permalink
Fix sphinx warnings (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones authored Nov 16, 2024
1 parent 545cae7 commit 09e4752
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 10 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
Expand Down Expand Up @@ -78,7 +87,7 @@
'custom.css',
]

html_logo = "_static/_future_logo.png"
# html_logo = "_static/_future_logo.png"

html_static_path = ["_static"]

Expand Down
24 changes: 12 additions & 12 deletions virtualizarr/manifests/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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")
Expand Down

0 comments on commit 09e4752

Please sign in to comment.