Skip to content

Commit 801e7b6

Browse files
committed
add warning if fill_value='default' used for non primitive data type
1 parent f3eba10 commit 801e7b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/netCDF4/_netCDF4.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,6 +4414,11 @@ behavior is similar to Fortran or Matlab, but different than numpy.
44144414
if not fillval.dtype.isnative: fillval.byteswap(True)
44154415
_set_att(self._grp, self._varid, '_FillValue',\
44164416
fillval, xtype=xtype)
4417+
else:
4418+
msg = """
4419+
WARNING: there is no default fill value for this data type, so fill_value='default'
4420+
does not do anything."""
4421+
warnings.warn(msg)
44174422
else:
44184423
if self._isprimitive or self._isenum or \
44194424
(self._isvlen and self.dtype == str):

0 commit comments

Comments
 (0)