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
Backport convert_coordinate_units (xarray 0.15.1 fix) to 0.12.x #1349
Conversation
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. |
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.
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! |
Description Of Changes
Backports the
convert_coordinate_units
accessor method from #1325, and modifies theparse_cf
internals to use it andassign_coords
instead of theunit_array
setter, which had used the (as of xarray 0.15.1) disallowed.values
assignment on coordinates. This should allowparse_cf
to work again with xarray 0.15.1.Checklist
Closes #xxxx