Skip to content

Commit 24e305c

Browse files
committed
remove occasional bug with fillvalues
1 parent 653315b commit 24e305c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

obsarray/templater/dswriter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def _write_netcdf(ds, path, compression_level=None):
8181
)
8282
}
8383
)
84-
ds[var_name].attrs.pop("_FillValue")
84+
if "_FillValue" in ds[var_name].attrs:
85+
ds[var_name].attrs.pop("_FillValue")
8586
encoding.update({var_name: var_encoding})
8687

8788
ds.to_netcdf(path, format="netCDF4", engine="netcdf4", encoding=encoding)

0 commit comments

Comments
 (0)