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

Do not return <this-array> instances #180

Merged
merged 2 commits into from
Feb 24, 2021
Merged

Do not return <this-array> instances #180

merged 2 commits into from
Feb 24, 2021

Conversation

aulemahal
Copy link
Contributor

Small fix for #179.

Modified _get_with_standard_name so that when used on a DataArray, it cannot return itself (the <this-array> variable in the temp dataset). This match the previous behavior (I think?) and fits the returned error message : ds.air.cf['air_temperature'] fails because 'air_temperature' doesn't appear in ds.air.cf. But ds.lat.cf['latitude'] works, since 'latitude' appears in ds.lat.cf.

Also added a minimal test.

@aulemahal aulemahal requested a review from dcherian February 24, 2021 19:49
@codecov-io
Copy link

Codecov Report

Merging #180 (638b38d) into main (af85a2a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #180   +/-   ##
=======================================
  Coverage   96.09%   96.10%           
=======================================
  Files          11       11           
  Lines        1356     1359    +3     
=======================================
+ Hits         1303     1306    +3     
  Misses         53       53           
Flag Coverage Δ
unittests 96.10% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cf_xarray/accessor.py 94.90% <100.00%> (ø)
cf_xarray/tests/test_accessor.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af85a2a...638b38d. Read the comment docs.

@dcherian
Copy link
Contributor

Great! merging. Can you test your downstream packages to make sure there are not other issues.

@dcherian dcherian merged commit 54b897a into main Feb 24, 2021
@dcherian dcherian deleted the fix-179 branch February 24, 2021 19:59
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 this pull request may close these issues.

3 participants