Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ensure absolute paths work with consolidate metadata#3428

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
d-v-b merged 3 commits intozarr-developers:mainfromshoyer:consolidated-subgroup
Sep 3, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionschanges/3428.bugfix.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
Ensure syntax like ``root['/subgroup']`` works equivalently to ``root['subgroup']`` when using consolidated metadata.
2 changes: 1 addition & 1 deletionsrc/zarr/core/group.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -735,7 +735,7 @@ def _getitem_consolidated(
assert self.metadata.consolidated_metadata is not None

# we support nested getitems like group/subgroup/array
indexers = key.split("/")
indexers =normalize_path(key).split("/")
indexers.reverse()
metadata: ArrayV2Metadata | ArrayV3Metadata | GroupMetadata = self.metadata

Expand Down
15 changes: 15 additions & 0 deletionstests/test_metadata/test_consolidated.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -692,6 +692,21 @@ async def test_use_consolidated_for_children_members(
expected = ["b", "b/c"]
assert result == expected

async def test_absolute_path_for_subgroup(self, memory_store: zarr.storage.MemoryStore) -> None:
root = await zarr.api.asynchronous.create_group(store=memory_store)
await root.create_group("a/b")
with pytest.warns(
ZarrUserWarning,
match="Consolidated metadata is currently not part in the Zarr format 3 specification.",
):
await zarr.api.asynchronous.consolidate_metadata(memory_store)

group = await zarr.api.asynchronous.open_group(store=memory_store)
subgroup = await group.getitem("/a")
assert isinstance(subgroup, AsyncGroup)
members = [x async for x in subgroup.keys()] # noqa: SIM118
assert members == ["b"]


@pytest.mark.parametrize("fill_value", [np.nan, np.inf, -np.inf])
async def test_consolidated_metadata_encodes_special_chars(
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp