Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove compression argument from CF writer save_datasets #1699

Closed
BENR0 opened this issue May 28, 2021 · 4 comments
Closed

Remove compression argument from CF writer save_datasets #1699

BENR0 opened this issue May 28, 2021 · 4 comments
Assignees

Comments

@BENR0
Copy link
Collaborator

BENR0 commented May 28, 2021

Feature Request

Is your feature request related to a problem? Please describe.
The documentation says the compression argument is passed on to xarray's to_netcdf method and links to the xarray documentation for more information. This is a little confusing because
the to_netcdf method does not have a compression argument. Instead the compression can be specified b within the encoding dictionary. While this in itself might confuse users additionally it is unclear what will happen if the user supplies an encoding dictionary to the save_datasets method which includes information regarding compression. Which setting takes precedence then?

Describe the solution you'd like
In order to keep it close to the to_netcdf method the compression parameter should be removed and the documentation updated that compression is possible using the encoding parameter which will be passed to to_netcdf together with the link to the xarray documentation.

Describe any changes to existing user workflow
The default behavior should not change but users currently using the compression argument would need to change their code.

@sfinkens
Copy link
Member

I agree, good catch!

@djhoese
Copy link
Member

djhoese commented May 31, 2021

Do either of you have the time to make a PR for this?

@mraspaud
Copy link
Member

@djhoese not really, but still...

@mraspaud
Copy link
Member

mraspaud commented Jun 1, 2021

Ok, after some discussion on slack, it seems to be a consensus that the default behaviour of compressing netcdf files should be phased-out to let the user take control through the encoding parameter and attribute, as is done in xarray.to_netcdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants