Skip to content

Commit

Permalink
pin_kerchunk_0.2.2 (#75)
Browse files Browse the repository at this point in the history
* add test vs kerchunk inlining

* pin_kerchunk_0.2.2

replaces: #74

* ensure kerchunk doesn't try to inline anything itself

* Revert "add test vs kerchunk inlining"

This reverts commit d27ba38.

---------

Co-authored-by: TomNicholas <tom@cworthy.org>
  • Loading branch information
norlandrhagen and TomNicholas authored Apr 5, 2024
1 parent 6fef91c commit 1fc3f0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ requires-python = ">=3.9"
dynamic = ["version"]
dependencies = [
"xarray",
"kerchunk",
"kerchunk==0.2.2",
"pydantic",
"packaging",
]
Expand Down
8 changes: 4 additions & 4 deletions virtualizarr/kerchunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@ 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
raise NotImplementedError(f"Unsupported file type: {filetype}")
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}")

Expand Down

0 comments on commit 1fc3f0b

Please sign in to comment.