Skip to content

Commit ebff31c

Browse files
authored
Fix zero-dim variables in netCDF3 (#554)
1 parent eff8648 commit ebff31c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

kerchunk/netCDF3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def translate(self):
298298
out = inline_array(
299299
out,
300300
self.threshold,
301-
remote_options=dict(remote_options=self.storage_options),
301+
remote_options=self.storage_options,
302302
)
303303
if isinstance(out, LazyReferenceMapper):
304304
out.flush()

kerchunk/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def refs_as_fs(
2828
"""Convert a reference set to an fsspec filesystem"""
2929
if fs is not None:
3030
fs.asynchronous = asynchronous
31+
else:
32+
remote_options = remote_options.copy() if remote_options else {}
33+
remote_options["asynchronous"] = asynchronous
3134
fs = fsspec.filesystem(
3235
"reference",
3336
fo=refs,
@@ -302,7 +305,7 @@ def _inline_array(group, threshold, names, prefix=""):
302305
cond2 = prefix1 in names
303306
if cond1 or cond2:
304307
original_attrs = dict(thing.attrs)
305-
data = thing[:]
308+
data = thing[...]
306309
arr = group.create_array(
307310
name=name,
308311
dtype=thing.dtype,
@@ -311,7 +314,7 @@ def _inline_array(group, threshold, names, prefix=""):
311314
fill_value=thing.fill_value,
312315
overwrite=True,
313316
)
314-
arr[:] = data
317+
arr[...] = data
315318
arr.attrs.update(original_attrs)
316319

317320

0 commit comments

Comments
 (0)