Skip to content

Commit 3b50e3c

Browse files
authored
Merge pull request #338 from rabernat/consolidated_pass_kwargs
pass kwargs to consolidate
2 parents e44c4c5 + a0f34d3 commit 3b50e3c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

zarr/convenience.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ def is_zarr_key(key):
11311131
return open_consolidated(store, metadata_key=metadata_key)
11321132

11331133

1134-
def open_consolidated(store, metadata_key='.zmetadata', mode='r+'):
1134+
def open_consolidated(store, metadata_key='.zmetadata', mode='r+', **kwargs):
11351135
"""Open group using metadata previously consolidated into a single key.
11361136
11371137
This is an optimised method for opening a Zarr group, where instead of
@@ -1158,6 +1158,9 @@ def open_consolidated(store, metadata_key='.zmetadata', mode='r+'):
11581158
read/write (must exist) although only writes to data are allowed,
11591159
changes to metadata including creation of new arrays or group
11601160
are not allowed.
1161+
**kwargs
1162+
Additional parameters are passed through to :func:`zarr.creation.open_array` or
1163+
:func:`zarr.hierarchy.open_group`.
11611164
11621165
Returns
11631166
-------
@@ -1182,4 +1185,4 @@ def open_consolidated(store, metadata_key='.zmetadata', mode='r+'):
11821185
meta_store = ConsolidatedMetadataStore(store, metadata_key=metadata_key)
11831186

11841187
# pass through
1185-
return open(store=meta_store, chunk_store=store, mode=mode)
1188+
return open(store=meta_store, chunk_store=store, mode=mode, **kwargs)

zarr/tests/test_convenience.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ def test_consolidate_metadata():
163163
with pytest.raises(ValueError):
164164
open_consolidated(store, mode='w')
165165

166+
# make sure keyword arguments are passed through without error
167+
open_consolidated(store, cache_attrs=True, synchronizer=None)
168+
166169

167170
class TestCopyStore(unittest.TestCase):
168171

0 commit comments

Comments
 (0)