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

Fix sphinx warnings #300

Merged
merged 5 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
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
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
Loading