Skip to content

Commit

Permalink
Reallow version override (but don't require)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Nov 9, 2023
1 parent d293cff commit e356937
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions kerchunk/netCDF3.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class NetCDF3ToZarr(netcdf_file):
def __init__(
self,
filename,
*args,
storage_options=None,
inline_threshold=100,
max_chunk_size=0,
Expand Down Expand Up @@ -70,16 +69,14 @@ def __init__(
self.fp = fsspec.open(filename, **(storage_options or {})).open()
magic = self.fp.read(4)
assert magic[:3] == b"CDF"
version = magic[3]
version = kwargs.pop("version", None) or magic[3]
self.fp.seek(0)
super().__init__(
self.fp,
*args,
mmap=False,
mode="r",
maskandscale=False,
version=version,
**kwargs,
)
self.filename = filename # this becomes an attribute, so must ignore on write

Expand Down

0 comments on commit e356937

Please sign in to comment.