Open
Description
... since zarr doesn't support attributes that are not JSON-serializable (including numpy arrays). This can be fixed like this (I don't have time to submit a PR myself right now):
diff --git a/kerchunk/grib2.py b/kerchunk/grib2.py
index e3a927b..0aa2ee6 100644
--- a/kerchunk/grib2.py
+++ b/kerchunk/grib2.py
@@ -103,7 +104,10 @@ def _store_array(store, z, data, var, inline_threshold, offset, size, attr):
overwrite=True,
)
store[f"{var}/" + ".".join(["0"] * len(shape))] = ["{{u}}", offset, size]
- d.attrs.update(attr)
+ d.attrs.update({
+ k: v.tolist() if isinstance(v, np.ndarray) else v
+ for k, v in attr.items()
+ })
def scan_grib(
Metadata
Metadata
Assignees
Labels
No labels