Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pygmt/tests/test_grdclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ def test_grdclip_replace():
npt.assert_array_equal(np.unique(grid), [1, 2])


def test_grdclip_replace_repeated():
"""
Test passing a 2-D sequence to the replace parameter for grdclip.
"""
grid = load_earth_mask(region=[0, 10, 0, 10])
npt.assert_array_equal(np.unique(grid), [0, 1]) # Only have 0 and 1
result = grdclip(grid=grid, replace=[[0, 2], [1, 3]])
npt.assert_array_equal(np.unique(result), [2, 3])


def test_grdclip_between_repeated():
"""
Test passing a 2-D sequence to the between parameter for grdclip.
Expand Down
Loading