diff --git a/_modules/kerchunk/netCDF3.html b/_modules/kerchunk/netCDF3.html index 38b1d6d8..262c8b0f 100644 --- a/_modules/kerchunk/netCDF3.html +++ b/_modules/kerchunk/netCDF3.html @@ -141,6 +141,7 @@

Source code for kerchunk.netCDF3

         self.threshold = inline_threshold
         self.max_chunk_size = max_chunk_size
         self.out = {}
+        self.storage_options = storage_options
         with fsspec.open(filename, **(storage_options or {})) as fp:
             super().__init__(
                 fp, *args, mmap=False, mode="r", maskandscale=False, **kwargs
@@ -341,7 +342,7 @@ 

Source code for kerchunk.netCDF3

         )
 
         if self.threshold > 0:
-            out = do_inline(out, self.threshold)
+            out = do_inline(out, self.threshold, remote_options=self.storage_options)
         out = _encode_for_JSON(out)
 
         return {"version": 1, "refs": out}
diff --git a/_modules/kerchunk/utils.html b/_modules/kerchunk/utils.html index 84c2e1ed..3a482c1a 100644 --- a/_modules/kerchunk/utils.html +++ b/_modules/kerchunk/utils.html @@ -216,13 +216,18 @@

Source code for kerchunk.utils

     return store
 
 
-
[docs]def do_inline(store, threshold, remote_options=None): +
[docs]def do_inline(store, threshold, remote_options=None, remote_protocol=None): """Replace short chunks with the value of that chunk The chunk may need encoding with base64 if not ascii, so actual length may be larger than threshold. """ - fs = fsspec.filesystem("reference", fo=store, **(remote_options or {})) + fs = fsspec.filesystem( + "reference", + fo=store, + remote_options=remote_options, + remote_protocol=remote_protocol, + ) out = fs.references.copy() get_keys = [ k @@ -314,6 +319,7 @@

Source code for kerchunk.utils

     modified store
     """
     fs = fsspec.filesystem("reference", fo=store)
+    store = copy.deepcopy(store)
     meta_file = f"{variable}/.zarray"
     meta = ujson.loads(fs.cat(meta_file))
     if meta["compressor"] is not None:
diff --git a/reference.html b/reference.html
index 98c6266d..e1a5af59 100644
--- a/reference.html
+++ b/reference.html
@@ -804,7 +804,7 @@ 

Utilities
-kerchunk.utils.do_inline(store, threshold, remote_options=None)[source]
+kerchunk.utils.do_inline(store, threshold, remote_options=None, remote_protocol=None)[source]

Replace short chunks with the value of that chunk

The chunk may need encoding with base64 if not ascii, so actual length may be larger than threshold.