From 1fc3f0bea4588e211c83a5fdeb6e269c9266c5d0 Mon Sep 17 00:00:00 2001 From: Raphael Hagen Date: Fri, 5 Apr 2024 14:08:57 -0600 Subject: [PATCH] pin_kerchunk_0.2.2 (#75) * add test vs kerchunk inlining * pin_kerchunk_0.2.2 replaces: https://github.com/TomNicholas/VirtualiZarr/pull/74 * ensure kerchunk doesn't try to inline anything itself * Revert "add test vs kerchunk inlining" This reverts commit d27ba38891581984171e648f5092a1acec4fb63b. --------- Co-authored-by: TomNicholas --- pyproject.toml | 2 +- virtualizarr/kerchunk.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f7353a57..c7505bca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ requires-python = ">=3.9" dynamic = ["version"] dependencies = [ "xarray", - "kerchunk", + "kerchunk==0.2.2", "pydantic", "packaging", ] diff --git a/virtualizarr/kerchunk.py b/virtualizarr/kerchunk.py index d8fcd829..2842ae4b 100644 --- a/virtualizarr/kerchunk.py +++ b/virtualizarr/kerchunk.py @@ -54,12 +54,12 @@ def read_kerchunk_references_from_file( if filetype.name.lower() == "netcdf3": from kerchunk.netCDF3 import NetCDF3ToZarr - refs = NetCDF3ToZarr(filepath).translate() + refs = NetCDF3ToZarr(filepath, inline_threshold=0).translate() elif filetype.name.lower() == "netcdf4": from kerchunk.hdf import SingleHdf5ToZarr - refs = SingleHdf5ToZarr(filepath).translate() + refs = SingleHdf5ToZarr(filepath, inline_threshold=0).translate() elif filetype.name.lower() == "grib": # TODO Grib files should be handled as a DataTree object # see https://github.com/TomNicholas/VirtualiZarr/issues/11 @@ -67,11 +67,11 @@ def read_kerchunk_references_from_file( elif filetype.name.lower() == "tiff": from kerchunk.tiff import tiff_to_zarr - refs = tiff_to_zarr(filepath) + refs = tiff_to_zarr(filepath, inline_threshold=0) elif filetype.name.lower() == "fits": from kerchunk.fits import process_file - refs = process_file(filepath) + refs = process_file(filepath, inline_threshold=0) else: raise NotImplementedError(f"Unsupported file type: {filetype.name}")