Skip to content

Open dataset cf options conflict solving #3544

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MeraX
Copy link
Contributor

@MeraX MeraX commented Nov 16, 2019

It took some time*, but here is a suggestion to solve option conflicts in xarray.open_dataset().

If any of the options mask_and_scale, decode_times, concat_characters, or decode_coords is manually set and contradicts the manually set choice of decode_cf a ValueError will be raised.
This commit requires to change some option default values of open_dataset() parameters from True to None. I hope this is acceptable.

What do you think? Do I have to add something to whats-new.rst and api.rst?

PS: (*) This is my first PR of this kind and I wanted to build it in a proper testing environment, but I had to set this up first.

* add tests for combinations of decode_cf and mask_and_scale

* add tests for combinations of decode_cf and decode_times

* add tests for combinations of decode_cf and concat_characters

* add tests for non-conflicting options ofconcat_characters and
  decode_times

relates to GH3020
Four default options of open_dataset() are changed from True to None in
order to enable checks that a manual setting for `decode_cf` does not
conflict with a manual setting of `mask_and_scale`, `decode_times`,
`concat_characters`, or `decode_coords`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can we clarify decode_cf option of open_dataset?
2 participants