Skip to content

Commit

Permalink
Start deprecation cycle for cf compression
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Jun 1, 2021
1 parent 91fefbc commit 9545596
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion satpy/writers/cf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,16 +728,21 @@ def save_datasets(self, datasets, filename=None, groups=None, header_attrs=None,
Compression to use on the datasets before saving, for example {'zlib': True, 'complevel': 9}.
This is in turn passed the xarray's `to_netcdf` method:
http://xarray.pydata.org/en/stable/generated/xarray.Dataset.to_netcdf.html for more possibilities.
(This parameter is now being deprecated, please use the DataArrays's `encoding` from now on.)
include_orig_name (bool).
Include the original dataset name as an varaibel attribute in the final netcdf
numeric_name_prefix (str):
Prefix to add the each variable with name starting with a digit. Use '' or None to leave this out.
"""
logger.info('Saving datasets to NetCDF4/CF.')

warnings.warn("The default behaviour of the CF writer will soon change to not compress data by default.",
FutureWarning)
if compression is None:
compression = {'zlib': True}
else:
warnings.warn("The `compression` keyword will soon be deprecated. Please use then `encoding` of the "
"DataArrays to tune compression from now on.", FutureWarning)

# Write global attributes to file root (creates the file)
filename = filename or self.get_filename(**datasets[0].attrs)
Expand Down

0 comments on commit 9545596

Please sign in to comment.