Skip to content

Commit 61121e5

Browse files
author
Jeff Whitaker
committed
add comments
1 parent 459dd04 commit 61121e5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/netCDF4/_netCDF4.pyx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4648,15 +4648,18 @@ pre-filled)."""
46484648
with nogil:
46494649
ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
46504650
_ensure_nc_success(ierr)
4651-
if no_fill == 1:
4651+
if no_fill == 1: # no filling for this variable
46524652
return None
46534653
else:
46544654
try:
46554655
fillval = self._FillValue
46564656
except AttributeError:
4657+
# _FillValue attribute not set, use default _FillValue
4658+
# for primite datatypes.
46574659
if self._isprimitive:
4658-
return default_fillvals[self.dtype.str[1:]]
4660+
return np.asarray(default_fillvals[self.dtype.str[1:]],self.dtype)
46594661
else:
4662+
# no default filling for non-primitive datatypes.
46604663
return None
46614664

46624665
def ncattrs(self):

0 commit comments

Comments
 (0)