Skip to content

Commit

Permalink
Fix padding in netcdf3 translation
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiannucci committed Oct 2, 2023
1 parent 3fb9147 commit 9172468
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kerchunk/netCDF3.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,15 @@ def translate(self):
outer_shape = size // dt.itemsize
offset = start
for name in dt.names:
dtype = dt[name]

# Skip padding, but increment offset.
if name.startswith("_padding_"):
offset += dtype.itemsize
continue

# the order of the names if fixed and important!
var = self.variables[name]
dtype = dt[name]
base = dtype.base # actual dtype
shape = (outer_shape,) + dtype.shape

Expand Down

0 comments on commit 9172468

Please sign in to comment.