xcube-dev / xcube-sh

An xcube plugin to allow generating data cubes from the Sentinel Hub Cloud API
MIT License
13 stars 10 forks source link

Silcence Zarr warning about consolidated metadata #69

Closed forman closed 3 years ago

forman commented 3 years ago

With new versions of Zarr and xarray, users of xcube will always see following warning when opening data cubes from xcube-sh:

some_module.py:77: RuntimeWarning: Failed to open Zarr store with consolidated metadata, falling back to try reading non-consolidated metadata. This is typically much slower for opening a dataset. To silence this warning, consider:
1. Consolidating metadata in this existing store with zarr.consolidate_metadata().
2. Explicitly setting consolidated=False, to avoid trying to read consolidate metadata, or
3. Explicitly setting consolidated=True, to raise an error in this case instead of falling back to try reading non-consolidated metadata.
  dataset = xarray.open_zarr(src_store)

This can be suppressed by adding a generated .zmetadata to the chunk store.