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

Array ordering for 2D calculations #392

Merged
merged 4 commits into from Apr 17, 2017

Conversation

dopplershift
Copy link
Member

@dopplershift dopplershift commented Apr 15, 2017

Closes #389 . Adds a kwarg dim_order that can be set to either 'xy', 'yx', or None, which uses the default. Currently the default is left to 'xy', but a warning is issued if the default is used. Refactor all the calculations to use yx ordering internally (to be most efficient for the common case), and added a decorator to flip all incoming arrays based on dim_order.

Also added some more tests to ensure that we're handling the transposes correctly (old tests had a lot of symmetric data).

By fixing the array ordering of these functions as xy, users are most
frequently needing a large amount of transposes. Instead, we make it
possible to specify the ordering. For now, we keep the same default, but
issue a warning because we will change in 0.6.

Add a decorator to change all incoming arrays as necessary based on the
dim_order kwarg, and make all calculations assume y, x order so that
they operate most efficiently on the common case.
Ensure that they work with asymmetric fields (to catch transpose
problems). Also add a test for the warning when using the default
array order.
@dopplershift dopplershift added Area: Calc Pertains to calculations Type: Enhancement Enhancement to existing functionality labels Apr 15, 2017
@dopplershift dopplershift added this to the 0.5.1 Bugfix milestone Apr 15, 2017
Copy link
Contributor

@jrleeman jrleeman left a comment

Choose a reason for hiding this comment

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

Seems like a sane way to handle this. Looks like the code quality tool warnings can all be safely merged over.

@dopplershift dopplershift merged commit 4182968 into Unidata:master Apr 17, 2017
@dopplershift dopplershift deleted the array-order branch April 17, 2017 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations Type: Enhancement Enhancement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants