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

Implement more Variable Coders #7719

Merged
merged 8 commits into from
Apr 7, 2023
Merged

Implement more Variable Coders #7719

merged 8 commits into from
Apr 7, 2023

Conversation

kmuehlbauer
Copy link
Contributor

@kmuehlbauer kmuehlbauer commented Apr 5, 2023

  • User visible changes (including notable bug fixes) are documented in whats-new.rst

This PR implements remaining functionality in encode_cf_variable/decode_cf_variable as VariableCoders (as left as todo by @shoyer). It adapts the needed tests and adds some typing (thanks @Illviljan). Otherwise there are no changes in function to code.

It splits out of #7654 which turns out to be hard to follow (at least for me).

This was referenced Apr 5, 2023
@kmuehlbauer kmuehlbauer changed the title Implement Cf coders Implement CF coders Apr 5, 2023
Copy link
Contributor

@dcherian dcherian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kmuehlbauer ! Good stuff!

It's definitely a good idea to split big changes into smaller, easier-to-review pieces, so thank you!

xarray/coding/variables.py Show resolved Hide resolved
xarray/coding/variables.py Outdated Show resolved Hide resolved
xarray/coding/variables.py Show resolved Hide resolved
xarray/conventions.py Show resolved Hide resolved
@dcherian dcherian changed the title Implement CF coders Implement more Variable Coders Apr 6, 2023
@kmuehlbauer
Copy link
Contributor Author

kmuehlbauer commented Apr 6, 2023

Now, this is interesting! It looks like those FillValue issues are following me. What did change that this now materializes here, all of a sudden.

Update: Small change - big issue. Checked for fv_exists instead of not fv_exists 😬

@kmuehlbauer
Copy link
Contributor Author

This looks like it is ready to go. This will surely help further refactoring encode_cf_variable/decode_cf_variable. At least while working on it I spotted several locations where inconsistencies can be ironed out. A neat mostly flaw-free encoding/decoding is needed especially with regard to #6323.

@dcherian
Copy link
Contributor

dcherian commented Apr 7, 2023

Thanks @kmuehlbauer

@dcherian dcherian merged commit 551de70 into pydata:main Apr 7, 2023
@kmuehlbauer kmuehlbauer deleted the cf-coders branch April 7, 2023 06:27
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.

3 participants