PI-2472: _regrid_area_weighted_array: Set order y_dim, x_dim axis to be last dimensions#3587
Closed
abooton wants to merge 2 commits intoSciTools:masterfrom
Closed
Conversation
12 tasks
ehogan
suggested changes
Dec 11, 2019
| x_dim = src_data.ndim - 1 | ||
| y_dim = src_data.ndim - 2 | ||
|
|
||
| # Create empty data array to match the new grid. |
Contributor
There was a problem hiding this comment.
- test_regrid_transposed is the only test that has an input that is affected by
np.moveaxis(the fourth loop). Would it be possible to add a test with an input that is affected bynp.moveaxisfor each of the other loops? - Since all the other tests don't require any axes to be moved, is it worth performing a check to determine whether an axis needs to be moved before moving it?
Contributor
Author
There was a problem hiding this comment.
Possibly. If we add a test for data ordered: [x, z, y], and like [y, x, z] I think this captures most of it. In the next PR we ensure we have x and y dims to might want to re-evaluate this next.
2124de1 to
3a14cb1
Compare
stickler-ci
reviewed
Dec 12, 2019
| z = src.coord("model_level_number") | ||
| lat = src.coord("grid_latitude") | ||
| lon = src.coord("grid_longitude") | ||
| z_shape = 4 |
There was a problem hiding this comment.
F841 local variable 'z_shape' is assigned to but never used
| lat = src.coord("grid_latitude") | ||
| lon = src.coord("grid_longitude") | ||
| z_shape = 4 | ||
| lat_shape = 3 |
There was a problem hiding this comment.
F841 local variable 'lat_shape' is assigned to but never used
| lon = src.coord("grid_longitude") | ||
| z_shape = 4 | ||
| lat_shape = 3 | ||
| lon_shape = 2 |
There was a problem hiding this comment.
F841 local variable 'lon_shape' is assigned to but never used
3a14cb1 to
0792ad1
Compare
Contributor
|
Closing as superseded by #3594 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-order the axis to be [..., y_dim, x_dim]. The weights.T then becomes redundant.
Changes are in preparation for optimising the averaging.