Skip to content

Commit

Permalink
Increase coverage with hand test
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbartos committed Apr 1, 2020
1 parent 8a745bd commit bce9107
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Initialize grid
grid = Grid()
crs = pyproj.Proj('+init=epsg:4326', preserve_units=True)
crs = pyproj.Proj('epsg:4326', preserve_units=True)
grid.read_ascii(dir_path, 'dir', dtype=np.uint8, crs=crs)
grid.read_raster(dem_path, 'dem')
grid.read_raster(roi_path, 'roi')
Expand All @@ -37,8 +37,8 @@
cells_in_catch = 11422
catch_shape = (159, 169)
max_distance = 209
new_crs = pyproj.Proj('+init=epsg:3083')
old_crs = pyproj.Proj('+init=epsg:4326', preserve_units=True)
new_crs = pyproj.Proj('epsg:3083')
old_crs = pyproj.Proj('epsg:4326', preserve_units=True)
x, y = -97.29416666666677, 32.73749999999989


Expand Down Expand Up @@ -138,6 +138,9 @@ def test_accumulation():
pos = np.where(grid.dinf_acc==grid.dinf_acc.max())
assert(np.round(grid.dinf_acc[pos] / grid.dinf_acc_eff[pos]) == 4.)

def test_hand():
grid.compute_hand('dir', 'dem', grid.acc > 100)

def test_flow_distance():
grid.clip_to('catch')
grid.flow_distance(x, y, data='catch', dirmap=dirmap, out_name='dist', xytype='label')
Expand Down

0 comments on commit bce9107

Please sign in to comment.