Skip to content

Commit 71a05f0

Browse files
authored
Fix vstack (#45)
* Fix vstack The numpy API now requires a sequence rather than an iterator so wrap in list before passing to `vstack` * Update test_api.py The numpy test utils moved
1 parent 2e4f6c6 commit 71a05f0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cis/collocation/data_index.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ def index_data(self, coords, hyper_points, coord_map):
7777
# Output is a list of coordinates which lists the indexes where the hyper points
7878
# should be located in the grid
7979
indices = np.vstack(
80-
np.where(
81-
ci < max_coordinate_value,
82-
np.searchsorted(bi, ci, side='right') - 1,
83-
-1)
84-
for bi, ci, max_coordinate_value in bounds_coords_max)
80+
[np.where(
81+
ci < max_coordinate_value,
82+
np.searchsorted(bi, ci, side='right') - 1,
83+
-1)
84+
for bi, ci, max_coordinate_value in bounds_coords_max])
8585

8686
# D-tuple giving the shape of the output grid
8787
grid_shape = tuple(len(bi_ci[0]) for bi_ci in bounds_coords_max)

cis/test/unit/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from cis.test.util.mock import make_mock_cube, make_regular_2d_ungridded_data
77
from cis.data_io.gridded_data import make_from_cube
88
import numpy as np
9-
from numpy.testing.utils import assert_array_almost_equal
9+
from numpy.testing import assert_array_almost_equal
1010

1111

1212
class TestAPI(TestCase):

0 commit comments

Comments
 (0)