Skip to content

Commit

Permalink
Merge pull request #1053 from jthielen/c-contiguous-fix
Browse files Browse the repository at this point in the history
Fix Scipy 1.3 not-C-contiguous error
  • Loading branch information
dopplershift committed Jun 6, 2019
2 parents 7370163 + 9dae20f commit 2d0600b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metpy/interpolate/grid.py
Expand Up @@ -61,7 +61,7 @@ def generate_grid_coords(gx, gy):
List of coordinates in meshgrid
"""
return np.vstack([gx.ravel(), gy.ravel()]).T
return np.stack([gx.ravel(), gy.ravel()], axis=1)


def get_xy_range(bbox):
Expand Down
1 change: 1 addition & 0 deletions metpy/interpolate/tests/test_grid.py
Expand Up @@ -142,6 +142,7 @@ def test_generate_grid_coords():
pts = generate_grid_coords(gx, gy)

assert_array_almost_equal(truth, pts)
assert pts.flags['C_CONTIGUOUS'] # need output to be C-contiguous


def test_natural_neighbor_to_grid(test_data, test_grid):
Expand Down
2 changes: 1 addition & 1 deletion metpy/interpolate/tests/test_points.py
Expand Up @@ -41,7 +41,7 @@ def test_points():
r"""Return point locations used for tests in this file."""
with get_test_data('interpolation_test_grid.npz') as fobj:
data = np.load(fobj)
return np.vstack([data['xg'].reshape(-1), data['yg'].reshape(-1)]).transpose()
return np.stack([data['xg'].reshape(-1), data['yg'].reshape(-1)], axis=1)


def test_nn_point(test_data):
Expand Down
2 changes: 1 addition & 1 deletion metpy/static-data-manifest.txt
Expand Up @@ -16,7 +16,7 @@ cubic_test.npz 8b9d01c2177a057b3352bb6c5b775dae6b796d37ba35b4775fcb65300dc06ccf
dec9_sounding.txt 4f60955bee4a59e2da0c225d778b9a04a149e9a17b4dce6bfefc111240b3b165
gfs_output.nc d25cc505204118d8e352b5bae6ff24a50c5e97a554e4f40cc1f0b6f0f84a9755
interpolation_test_grid.npz 6549bf00a8b77a50cd58f07419d1f6a4c629580ad1ef43cecd04eb70b9bd4020
interpolation_test_points.npz 9fb7ccdc62cead528355371c00cad446b68e84be83cec6df5ca9b2c05ef08ee3
interpolation_test_points.npz 17825f01377a39528a701ecfa04124e5e52af2ef6dc594f74a34449d423e244c
irma_gfs_example.nc 98e582bca9467e9c77aafa1e5079d6bedebaa97fabe79711bd911b32d92c32e2
jan20_sounding.txt 3de8c3a9daeffbfec3b6de9c67e14fe42728c4d6c2024d4543e2e74d4fb57315
linear_test.npz f1d22fe85cb602c8997d0008cbc44363da30fed805302c4bbb34bfbc7b37270a
Expand Down
Binary file modified staticdata/interpolation_test_points.npz
Binary file not shown.

0 comments on commit 2d0600b

Please sign in to comment.