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

Don't apply mappers to DataArrays #227

Merged
merged 5 commits into from
May 27, 2021
Merged

Don't apply mappers to DataArrays #227

merged 5 commits into from
May 27, 2021

Conversation

malmans2
Copy link
Member

Closes #226

@codecov
Copy link

codecov bot commented May 22, 2021

Codecov Report

Merging #227 (d40ec2d) into main (24bf4d3) will decrease coverage by 0.11%.
The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #227      +/-   ##
==========================================
- Coverage   96.45%   96.34%   -0.12%     
==========================================
  Files          14       14              
  Lines        1609     1614       +5     
==========================================
+ Hits         1552     1555       +3     
- Misses         57       59       +2     
Flag Coverage Δ
unittests 96.34% <92.30%> (-0.12%) ⬇️

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

Impacted Files Coverage Δ
cf_xarray/accessor.py 95.08% <85.71%> (-0.28%) ⬇️
cf_xarray/tests/test_accessor.py 100.00% <100.00%> (ø)
cf_xarray/utils.py 89.28% <100.00%> (+0.82%) ⬆️

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 24bf4d3...d40ec2d. Read the comment docs.

"metadata": {},
"outputs": [],
"source": [
"xr.set_options(keep_attrs=True)"
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like we've been running the intro notebook without xr.set_options(keep_attrs=True).
I don't think the issue without it was triggered by this PR, but I might be wrong.

Anyways, I think we should keep attributes and maybe re-discuss #77?

@malmans2 malmans2 changed the title Don't rename datarrays args Don't apply mappers to DataArrays May 22, 2021
cf_xarray/accessor.py Outdated Show resolved Hide resolved
cf_xarray/accessor.py Outdated Show resolved Hide resolved
cf_xarray/accessor.py Outdated Show resolved Hide resolved
@malmans2 malmans2 mentioned this pull request May 27, 2021
@dcherian
Copy link
Contributor

Thanks @malmans2 let's try it!

@dcherian dcherian merged commit 17f37b7 into main May 27, 2021
@dcherian dcherian deleted the da_args branch May 27, 2021 13:58
dcherian added a commit to jukent/cf-xarray that referenced this pull request Jun 8, 2021
* main: (57 commits)
  Add CITATION.cff, tributors, zenodo.json (xarray-contrib#231)
  Add zenodo badge
  Improve `rename_like` (xarray-contrib#222)
  Don't apply mappers to DataArrays (xarray-contrib#227)
  Add unit support to cf-xarray (xarray-contrib#197)
  Update README.rst
  Add earthcube 2021 notebook link to readme
  v0.5.2
  Some CMIP6 support
  Add pooch to binder environment (xarray-contrib#223)
  `add_bounds` uses `keys` rather than `dims` (xarray-contrib#221)
  Add .cf.formula_terms (xarray-contrib#213)
  Update whats-new.rst (xarray-contrib#217)
  add bounds property (xarray-contrib#214)
  Update some tests.
  Compile regexes
  Fix black
  Add __version__ (xarray-contrib#208)
  add skip to rename_like (xarray-contrib#206)
  Refactor out coordinate criteria to criteria.py (xarray-contrib#205)
  ...
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.

cf.weighted doesn't work with DataArrays
2 participants