From 14bf6b394fa3d39fe3d56512acfc3ed71d7791e4 Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Tue, 5 Mar 2024 13:13:24 -0500 Subject: [PATCH 1/2] inlining was not happening for HDF --- kerchunk/hdf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kerchunk/hdf.py b/kerchunk/hdf.py index f7115fca..03dafab5 100644 --- a/kerchunk/hdf.py +++ b/kerchunk/hdf.py @@ -458,7 +458,11 @@ def _translator(self, name: str, h5obj: Union[h5py.Dataset, h5py.Group]): if h5obj.fletcher32: logging.info("Discarding fletcher32 checksum") v["size"] -= 4 - if self.inline and isinstance(v, list) and v[2] < self.inline: + if ( + self.inline + and isinstance(v, dict) + and v["size"] < self.inline + ): self.input_file.seek(v["offset"]) data = self.input_file.read(v["size"]) try: From 68bd4a09fe893bd65b4ad0d7b320054ac8b2fe7e Mon Sep 17 00:00:00 2001 From: Martin Durant Date: Tue, 5 Mar 2024 13:26:25 -0500 Subject: [PATCH 2/2] fixit --- kerchunk/hdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kerchunk/hdf.py b/kerchunk/hdf.py index 03dafab5..46c325c8 100644 --- a/kerchunk/hdf.py +++ b/kerchunk/hdf.py @@ -470,7 +470,7 @@ def _translator(self, name: str, h5obj: Union[h5py.Dataset, h5py.Group]): data.decode("ascii") except UnicodeDecodeError: data = b"base64:" + base64.b64encode(data) - self.store[k] = data + self.store[za._chunk_key(k)] = data else: self.store[za._chunk_key(k)] = [ self._uri,