Hey! Very excited to use this.
I am getting some incorrect seeming results back from from_array for zarr v3 arrays using the latest (0.8.1) release. I had expected that this was supported now after seeing #53.
Here is an example of what I'm seeing:
from pydantic_zarr.v3 import ArraySpec, GroupSpec
import zarr
z = zarr.open_array(TST_URI)
z
# <Array <FsspecStore(S3FileSystem, ivirshup-sci-data-dev-tmp/scratch/take12/scale0.zarr)> shape=(96, 128, 512, 3328, 2) dtype=uint16>
spec = ArraySpec.from_array(z)
# ArraySpec(zarr_format=3, node_type='array', attributes={}, shape=(96, 128, 512, 3328, 2), data_type='uint16', chunk_grid={'name': 'regular', 'configuration': {'chunk_shape': (96, 128, 512, 3328, 2)}}, chunk_key_encoding={'name': 'default', 'configuration': {'separator': '/'}}, fill_value=0.0, codecs=(), storage_transformers=(), dimension_names=None)
z.chunks, z.shards
# ((1, 32, 32, 32, 1), (1, 128, 128, 128, 1))
spec.chunk_grid
# {'name': 'regular', 'configuration': {'chunk_shape': (96, 128, 512, 3328, 2)}}
z.compressors
# (ZstdCodec(level=3, checksum=False),)
spec.codecs
# ()
It looks like from_array is just failing to read most of the relevant structure metadata. Here is the zarr.json for this array:
zarr.json
{
"chunk_grid": {
"configuration": {
"chunk_shape": [
1,
128,
128,
128,
1
]
},
"name": "regular"
},
"chunk_key_encoding": {
"name": "default"
},
"codecs": [
{
"configuration": {
"chunk_shape": [
1,
32,
32,
32,
1
],
"codecs": [
{
"configuration": {
"endian": "little"
},
"name": "bytes"
},
{
"configuration": {
"checksum": false,
"level": 3
},
"name": "zstd"
}
],
"index_codecs": [
{
"configuration": {
"endian": "little"
},
"name": "bytes"
},
{
"name": "crc32c"
}
]
},
"name": "sharding_indexed"
}
],
"data_type": "uint16",
"fill_value": 0,
"node_type": "array",
"shape": [
96,
128,
512,
3328,
2
],
"zarr_format": 3
}
Hey! Very excited to use this.
I am getting some incorrect seeming results back from
from_arrayfor zarr v3 arrays using the latest (0.8.1) release. I had expected that this was supported now after seeing #53.Here is an example of what I'm seeing:
It looks like
from_arrayis just failing to read most of the relevant structure metadata. Here is the zarr.json for this array:zarr.json
{ "chunk_grid": { "configuration": { "chunk_shape": [ 1, 128, 128, 128, 1 ] }, "name": "regular" }, "chunk_key_encoding": { "name": "default" }, "codecs": [ { "configuration": { "chunk_shape": [ 1, 32, 32, 32, 1 ], "codecs": [ { "configuration": { "endian": "little" }, "name": "bytes" }, { "configuration": { "checksum": false, "level": 3 }, "name": "zstd" } ], "index_codecs": [ { "configuration": { "endian": "little" }, "name": "bytes" }, { "name": "crc32c" } ] }, "name": "sharding_indexed" } ], "data_type": "uint16", "fill_value": 0, "node_type": "array", "shape": [ 96, 128, 512, 3328, 2 ], "zarr_format": 3 }