From 08de01abf5913fdbb873452fd4ea1d21f1d4036d Mon Sep 17 00:00:00 2001 From: David Stansby Date: Thu, 15 May 2025 16:31:47 +0100 Subject: [PATCH 1/2] Don't compress data in hypothesis testing --- src/zarr/testing/stateful.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/zarr/testing/stateful.py b/src/zarr/testing/stateful.py index acc5f63f19..63718ebaa9 100644 --- a/src/zarr/testing/stateful.py +++ b/src/zarr/testing/stateful.py @@ -17,6 +17,7 @@ import zarr from zarr import Array from zarr.abc.store import Store +from zarr.codecs.bytes import BytesCodec from zarr.core.buffer import Buffer, BufferPrototype, cpu, default_buffer_prototype from zarr.core.sync import SyncMixin from zarr.storage import LocalStore, MemoryStore @@ -108,7 +109,14 @@ def add_array( assume(self.can_add(path)) note(f"Adding array: path='{path}' shape={array.shape} chunks={chunks}") for store in [self.store, self.model]: - zarr.array(array, chunks=chunks, path=path, store=store, fill_value=fill_value) + zarr.array( + array, + chunks=chunks, + path=path, + store=store, + fill_value=fill_value, + codecs=[BytesCodec()], + ) self.all_arrays.add(path) # @precondition(lambda self: bool(self.all_groups)) From 30d9029fd07cadf37fa8574cb24948d5a3cd8990 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Thu, 15 May 2025 16:33:37 +0100 Subject: [PATCH 2/2] Add comment --- src/zarr/testing/stateful.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zarr/testing/stateful.py b/src/zarr/testing/stateful.py index 63718ebaa9..f4f7b33318 100644 --- a/src/zarr/testing/stateful.py +++ b/src/zarr/testing/stateful.py @@ -115,6 +115,7 @@ def add_array( path=path, store=store, fill_value=fill_value, + # Chose bytes codec to avoid wasting time compressing the data being written codecs=[BytesCodec()], ) self.all_arrays.add(path)