manzt / zarrita.js

A JavaScript toolkit for working with chunked, compressed, n-dimensional arrays
https://zarrita.dev
MIT License
38 stars 5 forks source link

zarr v3 reading expects chunk_key_encoding.configuration #186

Closed will-moore closed 4 weeks ago

will-moore commented 4 weeks ago

I'm using zarrita.js in a work-in-progress PR at https://github.com/ome/ome-ngff-validator/pull/35 to load zarr v3 data generated by tensorstore with the script at https://github.com/ome/ome2024-ngff-challenge/blob/e69f3b14c9cb5562d8bd1d00d419bbaa7933f63d/dev1/resave.py

This failed with TypeError: Cannot read properties of undefined (reading 'separator') coming from: https://github.com/manzt/zarrita.js/blob/f838137481c40afdb6bed263a748cd9a65d7ed62/packages/core/src/util.ts#L114 where it's expecting the optional configuration block. https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html#chunk-encoding

Manually updating zarr.json to include it like:

"chunk_key_encoding": {
    "name": "default",
    "configuration": {
      "separator": "/"
    }
  },

fixed the issue.