Skip to content

Conversation

@jthielen
Copy link
Collaborator

@jthielen jthielen commented Dec 28, 2019

Description Of Changes

As noted in #1249 (comment), the grid deltas calculation does not handle dimension/axis order that are not (..., y, x), whereas a goal of MetPy's xarray integration is to be able to flexibly handle dimension order. This PR refactors lat_lon_grid_deltas and grid_deltas_from_dataarray to now flexibly handle dimension order. There were also some accompanying changes:

Checklist

dopplershift
dopplershift previously approved these changes Jan 13, 2020
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.

Looks good, just a minor question.

latitude = np.asarray(latitude)

# Determine dimension order for offset slicing
take_y = make_take(latitude.ndim, kwargs.pop('y_dim', -2))
Copy link
Member

Choose a reason for hiding this comment

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

Think this and x_dim could become a kwarg-only argument?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. Looking back at this, I'm not sure why I did it the way it is now.

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.

Waiting on CI

@dopplershift dopplershift merged commit b97458e into Unidata:master Jan 13, 2020
@jthielen jthielen mentioned this pull request Jul 1, 2020
3 tasks
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.

Documentation for axes in gradient calc Investigate improvements to clean up complex indexing

2 participants