Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jswhit committed Oct 20, 2024
1 parent 459dd04 commit 61121e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/netCDF4/_netCDF4.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4648,15 +4648,18 @@ pre-filled)."""
with nogil:
ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL)
_ensure_nc_success(ierr)
if no_fill == 1:
if no_fill == 1: # no filling for this variable
return None
else:
try:
fillval = self._FillValue
except AttributeError:
# _FillValue attribute not set, use default _FillValue
# for primite datatypes.
if self._isprimitive:
return default_fillvals[self.dtype.str[1:]]
return np.asarray(default_fillvals[self.dtype.str[1:]],self.dtype)
else:
# no default filling for non-primitive datatypes.
return None

def ncattrs(self):
Expand Down

0 comments on commit 61121e5

Please sign in to comment.