Skip to content

Commit 33da47b

Browse files
committed
use C API to get default fill values
1 parent 365fbab commit 33da47b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/netCDF4/_netCDF4.pyx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,13 +4656,12 @@ pre-filled)."""
46564656
except AttributeError:
46574657
# _FillValue attribute not set, see if we can retrieve _FillValue.
46584658
# for primitive data types.
4659-
if self._isprimitive
4660-
return np.array(default_fillvals[self.dtype.str[1:]],self.dtype)
4661-
#fillval = np.array(default_fillvals[self.dtype.str[1:]],self.dtype)
4662-
#with nogil:
4663-
# ierr=nc_inq_var_fill(self._grpid,self._varid,&no_fill,PyArray_DATA(fillval))
4664-
#_ensure_nc_success(ierr)
4665-
#return fillval
4659+
if self._isprimitive:
4660+
#return numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
4661+
fillval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype)
4662+
ierr=nc_inq_var_fill(self._grpid,self._varid,&no_fill,PyArray_DATA(fillval))
4663+
_ensure_nc_success(ierr)
4664+
return fillval
46664665
else:
46674666
# no default filling for non-primitive data types.
46684667
return None

0 commit comments

Comments
 (0)