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

Use Zarrita for v3 data generation #65

Merged

Conversation

maxrjones
Copy link
Contributor

@freeman-lab The data/chunking for the new stores from zarrita should be the same as in this branch with a few exceptions:

  • The string data formats aren't supported
  • The Zarr Python inner/outer chunks specification for 3d.chunked.mixed.compressed.sharded.i2.zarr (shown below) didn't make sense given our last conversation. Please let me know if you'd like a different chunking scheme relative to the zarrita version also shown below.
store = DirectoryStoreV3("data/v3/3d.chunked.mixed.compressed.sharded.i2.zarr")
sharding_transformer = ShardingStorageTransformer("indexed", chunks_per_shard=(3, 3, 1))
z = zarr.array(
    arange(27).reshape(3, 3, 3),
    dtype="i2",
    store=store,
    chunks=(3, 3, 1),
    compressor=Zlib(),
    storage_transformers=[sharding_transformer],
)
data = arange(27, dtype="i2").reshape(3, 3, 3)
path = "3d.chunked.mixed.compressed.sharded.i2.zarr"
a = asyncio.run(
    zarrita.Array.create_async(
        store / path,
        shape=data.shape,
        dtype=data.dtype,
        chunk_shape=(3, 3, 3),
        codecs=[
            zarrita.codecs.sharding_codec(
                chunk_shape=(3, 3, 1),
                codecs=[
                    zarrita.codecs.blosc_codec(
                        typesize=data.dtype.itemsize, cname="zlib"
                    )
                ],
            )
        ],
    )
)
a[:, :, :] = data

@freeman-lab freeman-lab merged commit b74edc6 into freeman-lab:freeman-lab/v3-support Jul 21, 2023
2 checks passed
@maxrjones maxrjones deleted the maxrjones/v3-zarrita branch July 21, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants