-
-
Notifications
You must be signed in to change notification settings - Fork 348
Ensure compressor=None results in no compression for V2 #2709
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
Changes from 1 commit
f10ba22
fac9e17
0dbe70a
1963647
fbc6a69
9625ca5
94f58bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -93,11 +93,7 @@ async def test_v2_encode_decode(dtype): | |||||
store = zarr.storage.MemoryStore() | ||||||
g = zarr.group(store=store, zarr_format=2) | ||||||
g.create_array( | ||||||
name="foo", | ||||||
shape=(3,), | ||||||
chunks=(3,), | ||||||
dtype=dtype, | ||||||
fill_value=b"X", | ||||||
name="foo", shape=(3,), chunks=(3,), dtype=dtype, fill_value=b"X", compressor=None | ||||||
) | ||||||
|
||||||
result = await store.get("foo/.zarray", zarr.core.buffer.default_buffer_prototype()) | ||||||
|
@@ -166,6 +162,18 @@ def test_v2_filters_codecs(filters: Any, order: Literal["C", "F"]) -> None: | |||||
np.testing.assert_array_equal(result, array_fixture) | ||||||
|
||||||
|
||||||
@pytest.mark.filterwarnings("ignore") | ||||||
def test_create_array_defaults(): | ||||||
store = zarr.storage.MemoryStore() | ||||||
martindurant marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
g = zarr.open(store, mode="w", zarr_format=2) | ||||||
arr = g.create_array("one", dtype="i8", shape=(1,), chunks=(1,), compressor=None) | ||||||
assert arr._async_array.compressor is None | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Does this work, too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but that's deprecated, apparently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So should be |
||||||
assert not (arr.filters) | ||||||
arr = g.create_array("two", dtype="i8", shape=(1,), chunks=(1,)) | ||||||
assert arr._async_array.compressor is not None | ||||||
assert not (arr.filters) | ||||||
|
||||||
|
||||||
@pytest.mark.parametrize("array_order", ["C", "F"]) | ||||||
@pytest.mark.parametrize("data_order", ["C", "F"]) | ||||||
@pytest.mark.parametrize("memory_order", ["C", "F"]) | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.