Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lat1le committed Nov 23, 2016
1 parent 5fa02c8 commit 09992b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/api/test_grid_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_gridworkflow():

# ------ introduce padding --------

assert len(gw.list_tiles(buffer=(20, 20), **query)) == 9
assert len(gw.list_tiles(tile_buffer=(20, 20), **query)) == 9

# ------ add another dataset (to test grouping) -----

Expand All @@ -64,7 +64,7 @@ def search_eager(lat=None, lon=None, **kwargs):
assert set(gw.list_tiles(**query).keys()) == {(1, -2, ti), (2, -2, ti)}

# padded
assert len(gw.list_tiles(buffer=(20, 20), **query)) == 12 # not 18=2*9 because of grouping
assert len(gw.list_tiles(tile_buffer=(20, 20), **query)) == 12 # not 18=2*9 because of grouping

# -------- inspect particular returned tile objects --------

Expand All @@ -74,7 +74,7 @@ def search_eager(lat=None, lon=None, **kwargs):
assert grid/pixel == 10
assert tile.shape == (1, 10, 10)

padded_tile = gw.list_tiles(buffer=(20, 20), **query)[1, -2, ti] # padded example
padded_tile = gw.list_tiles(tile_buffer=(20, 20), **query)[1, -2, ti] # padded example
# assert grid/pixel + 2*gw2.grid_spec.padding == 14 # GREG: understand this
assert padded_tile.shape == (1, 14, 14)

Expand Down Expand Up @@ -121,7 +121,7 @@ def search_eager(lat=None, lon=None, **kwargs):
assert tile[1, -2, ti].shape == (1, 10, 10)
assert len(tile[1, -2, ti].sources.values[0]) == 1

padded_tile = gw.list_tiles(cell_index=(1, -2), buffer=(20, 20), **query)
padded_tile = gw.list_tiles(cell_index=(1, -2), tile_buffer=(20, 20), **query)
assert len(padded_tile) == 1
assert padded_tile[1, -2, ti].shape == (1, 14, 14)
assert len(padded_tile[1, -2, ti].sources.values[0]) == 2

0 comments on commit 09992b4

Please sign in to comment.