Skip to content

Commit

Permalink
use C API to get default fill values
Browse files Browse the repository at this point in the history
  • Loading branch information
jswhit2 committed Oct 21, 2024
1 parent 365fbab commit 33da47b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/netCDF4/_netCDF4.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4656,13 +4656,12 @@ pre-filled)."""
except AttributeError:
# _FillValue attribute not set, see if we can retrieve _FillValue.
# for primitive data types.
if self._isprimitive
return np.array(default_fillvals[self.dtype.str[1:]],self.dtype)
#fillval = np.array(default_fillvals[self.dtype.str[1:]],self.dtype)
#with nogil:
# ierr=nc_inq_var_fill(self._grpid,self._varid,&no_fill,PyArray_DATA(fillval))
#_ensure_nc_success(ierr)
#return fillval
if self._isprimitive:
#return numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
fillval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
ierr=nc_inq_var_fill(self._grpid,self._varid,&no_fill,PyArray_DATA(fillval))
_ensure_nc_success(ierr)
return fillval
else:
# no default filling for non-primitive data types.
return None
Expand Down

0 comments on commit 33da47b

Please sign in to comment.