delay kerchunk netcdf3 import
@@ -5,7 +5,6 @@ Functions related to creating fsspec references.
from typing import Dict, Tuple, Union
from kerchunk.hdf import SingleHdf5ToZarr
-from kerchunk.netCDF3 import NetCDF3ToZarr
from .patterns import FileType
@@ -16,6 +15,8 @@ def create_kerchunk_reference(
if file_type == FileType.netcdf4:
chunks = SingleHdf5ToZarr(fp, url, inline_threshold=inline_threshold)
elif file_type == FileType.netcdf3:
+ from kerchunk.netCDF3 import NetCDF3ToZarr
+
chunks = NetCDF3ToZarr(url, max_chunk_size=100_000_000)
return chunks.translate()
