Skip to content

Commit

Permalink
Merge pull request #30 from sebhahn/master
Browse files Browse the repository at this point in the history
fix array concatenation bug
  • Loading branch information
cpaulik committed Oct 6, 2015
2 parents d97cea5 + b4ce9e2 commit 354123e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pygeogrids/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,9 @@ def grid_points_for_cell(self, cells):
lons.append(self.activearrlon[cell_index])
lats.append(self.activearrlat[cell_index])

gpis = np.array(gpis)
lons = np.array(lons)
lats = np.array(lats)
gpis = np.hstack(gpis)
lons = np.hstack(lons)
lats = np.hstack(lats)

return gpis, lons, lats

Expand Down
12 changes: 7 additions & 5 deletions tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,13 @@ def test_subgrid_from_cells(self):

for cell in cells:
gpis, lons, lats = subgrid.grid_points_for_cell(cell)
orig_gpis, orig_lons, orig_lats = \
self.cellgrid.grid_points_for_cell(cell)
nptest.assert_equal(gpis, orig_gpis)
nptest.assert_equal(lons, orig_lons)
nptest.assert_equal(lats, orig_lats)
cell_index = np.where(cell == self.cellgrid.activearrcell)
orig_gpis = self.cellgrid.activegpis[cell_index]
orig_lons = self.cellgrid.activearrlon[cell_index]
orig_lats = self.cellgrid.activearrlat[cell_index]
nptest.assert_array_equal(gpis, orig_gpis)
nptest.assert_array_equal(lons, orig_lons)
nptest.assert_array_equal(lats, orig_lats)

def test_subgrid_from_gpis(self):
"""
Expand Down

0 comments on commit 354123e

Please sign in to comment.