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

Backport convert_coordinate_units (xarray 0.15.1 fix) to 0.12.x #1349

Merged
merged 11 commits into from Apr 17, 2020
Merged

Backport convert_coordinate_units (xarray 0.15.1 fix) to 0.12.x #1349

merged 11 commits into from Apr 17, 2020

Conversation

jthielen
Copy link
Collaborator

Description Of Changes

Backports the convert_coordinate_units accessor method from #1325, and modifies the parse_cf internals to use it and assign_coords instead of the unit_array setter, which had used the (as of xarray 0.15.1) disallowed .values assignment on coordinates. This should allow parse_cf to work again with xarray 0.15.1.

Checklist

  • Closes #xxxx
  • Tests added
  • Fully documented

@dopplershift
Copy link
Member

I'm going to cherry pick some changes from master to add here. These are mainly about fixing tests, because I'd really like to see CI green here. I'll look at a few more backports before we cut 0.12.1.

@dopplershift dopplershift added Area: Units Pertains to unit information Area: Xarray Pertains to xarray integration Type: Bug Something is not working like it should labels Apr 14, 2020
@dopplershift dopplershift added this to the 0.12.1 milestone Apr 14, 2020
dopplershift and others added 10 commits April 14, 2020 01:40
So with pint's advances, it turns out `item()` no longer strips units.
This is #330 come back for revenge. The right answer is to just drop
units when calling `plot_parameter`. We don't want them, and there's no
format code that will drop units; while one could be added, this
wouldn't work with floats in general.
With the new pint release, some test images are now showing 0 instead of
-0 (which is actually an improvement. If we just adjust some values in
the tests, we don't even need to deal with this.
Now prints 'degrees_Celisus' by default instead of degC. Hack around
this by just setting the label to 'degC' for now. Also slightly bump
image test thresholds for some couple-pixel changes that have cropped
up.
Value slightly changed with Pint 0.10 constant changes, and this was
causing doctests to fail.
Wreaking havoc with Pint 0.10. Just need to use a different construction
method.
Have to see what's going on later.
One has minor pixel-level differences, the other looks like fallout from
matplotlib fixing some text positioning and clipping issues.
Update image to reflect matplotlib 3.2, and skip on all prior versions.
@dopplershift
Copy link
Member

Coverage drops are because I haven't backported all of the other changes that eliminated some unneeded fallback code. I'm going to punt that on this release. So let's merge and I'll pull in a few others now that we're passing!

@dopplershift dopplershift merged commit 3f6e5f8 into Unidata:0.12.x Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Units Pertains to unit information Area: Xarray Pertains to xarray integration Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants