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

Can we clarify decode_cf option of open_dataset? #3020

Open
MeraX opened this issue Jun 13, 2019 · 2 comments · May be fixed by #3544
Open

Can we clarify decode_cf option of open_dataset? #3020

MeraX opened this issue Jun 13, 2019 · 2 comments · May be fixed by #3544

Comments

@MeraX
Copy link
Contributor

MeraX commented Jun 13, 2019

Dea all,

I encountered a small unforeseen bug using the decode_cf of open_dataset. By only reading the doc string, I was not aware of the complete meaning of this parameter. Especially, that it overwrites other options.

Example:
ds = xarray.open_dataset(file_name, mask_and_scale=True, decode_cf=False)

The result is an unmasked and not sclaed dataset. decode_cf simply overwrites other options. See the code: https://github.com/pydata/xarray/blob/stable/xarray/backends/api.py#L308-L312

A simple solution would be to explain, that decode_cf sets mask_and_scale, decode_times, concat_characters, and decode_coords to False. But probably it would be more convenient to detect option conflicts like in my example and raise a ValueError.

What do you think? Do you prefer any of these options? I could write the little PR.

@dcherian
Copy link
Contributor

Thanks @MeraX.

+1 on raising an error. and +5 for sending in a PR :)

@MeraX MeraX linked a pull request Nov 16, 2019 that will close this issue
5 tasks
@MeraX
Copy link
Contributor Author

MeraX commented Nov 16, 2019

Good things take a while, but today I finally managed to create a PR. What do you think?

If there is more to to, let me know.

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

Successfully merging a pull request may close this issue.

2 participants