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

Allow user to explicitly disable coordinates attribute #5514

Merged
merged 10 commits into from
Jul 1, 2021

Conversation

ellesmith88
Copy link
Contributor

@ellesmith88 ellesmith88 commented Jun 23, 2021

@ellesmith88 ellesmith88 changed the title Issue/5510/remove coord attribute Explicitly disable coord attribute Jun 24, 2021
@dcherian dcherian changed the title Explicitly disable coord attribute Allow user to explicitly disable coordinates attribute Jun 29, 2021
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 @ellesmith88 ! This looks very nice.

I have some minor suggestions.

xarray/conventions.py Outdated Show resolved Hide resolved
xarray/conventions.py Outdated Show resolved Hide resolved
xarray/tests/test_conventions.py Outdated Show resolved Hide resolved

# check coordinate attribute not emitted for 'b'
assert enc["b"].attrs.get("coordinates") == "t"
assert enc["b"].encoding.get("coordinates") is None
Copy link
Contributor

Choose a reason for hiding this comment

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

nice tests.

Let's also test for when orig.a.encoding["coordinates"] = None

@github-actions
Copy link
Contributor

github-actions bot commented Jun 29, 2021

Unit Test Results

         6 files  ±0           6 suites  ±0   57m 59s ⏱️ ±0s
16 158 tests ±0  14 443 ✔️ ±0  1 715 💤 ±0  0 ❌ ±0 
90 144 runs  ±0  82 024 ✔️ ±0  8 120 💤 ±0  0 ❌ ±0 

Results for commit c472f8a. ± Comparison against base commit c472f8a.

♻️ This comment has been updated with latest results.

@ellesmith88
Copy link
Contributor Author

ellesmith88 commented Jun 29, 2021

@dcherian Thanks for the review, I've made those changes

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 @ellesmith88 this looks great to me!

@dcherian dcherian added the plan to merge Final call for comments label Jun 30, 2021
Copy link
Member

@andersy005 andersy005 left a comment

Choose a reason for hiding this comment

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

Thank you for your first PR contribution 🎉, @ellesmith88, and welcome to the xarray community!

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

Successfully merging this pull request may close these issues.

Can't remove coordinates attribute from DataArrays
3 participants