Open
Description
Zarr version
3.0.8
Numcodecs version
0.16.1
Python Version
3.12
Operating System
Linux
Installation
pip + venv
Description
I am struggling to add a Quantize filter before compression, with zarr v3.
I work with xarray (2025.6.1)
I get the following error :
TypeError: Expected a ArrayArrayCodec. Got <class 'numcodecs.quantize.Quantize'> instead.
Using from numcodecs.zarr3 import Quantize
leads another error :
TypeError: Object of type type is not JSON serializable
What is the proper way to add filters to encoding with zarr V3 & *xarray ?
Steps to reproduce
from numcodecs import Quantize
import numpy as np
encoding={
"var" : dict(filters=[Quantize(digits=2, dtype=np.float32)])
}
ds.to_zarr(..., encoding=encoding)
Additional output
No response