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

xarray Coordinate Identification Refactor #1058

Merged
merged 4 commits into from Jun 13, 2019
Merged

xarray Coordinate Identification Refactor #1058

merged 4 commits into from Jun 13, 2019

Conversation

jthielen
Copy link
Collaborator

@jthielen jthielen commented Jun 12, 2019

This PR changes how the systematic coordinate identification is done: previously, the parsing was a part of parse_cf() on the Dataset accessor, but now, as requested in #1030, it is done on-demand within the DataArray accessor. This allows the coordinate identification features to be used even when someone only has a DataArray and doesn't have a Dataset. These changes also come with a rename of the accessors to MetPyDataArrayAccessor and MetPyDatasetAccessor, and changing check_axis() from being a class method on the Dataset accessor to a function in the xarray module (since it is now used several times in calc and interpolate). Since it was an easy change along the way, this PR also sets the keep_attrs option on xarray.Dataset.apply() to True in parse_cf() to keep the attributes around after parsing.

Closes #1030 and closes #1051.

@dopplershift dopplershift added Area: Xarray Pertains to xarray integration Type: Enhancement Enhancement to existing functionality labels Jun 12, 2019
@dopplershift dopplershift added this to the 0.11 milestone Jun 12, 2019
Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

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

This looks really good, thanks for knocking these out.

@dopplershift
Copy link
Member

Ignoring codeclimate and codacy, since they're wrong IMO. Travis and now AppVeyor (since we have matplotlib 3.1 testing packages for windows) are failing from SkewT, so I'll merge over them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Xarray Pertains to xarray integration Type: Enhancement Enhancement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should parse_cf have a keep_attrs kwarg? Better document xarray integration
2 participants