Skip to content

Commit

Permalink
also add mask as invertion of the test array for mask sake for the te…
Browse files Browse the repository at this point in the history
…st_resample_from_array
  • Loading branch information
sevcikp committed Jan 9, 2025
1 parent c679a45 commit 69a9a70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test_io_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,12 @@ def test_resample_from_array():
out_array = resample_from_array(in_data, in_tile.affine, out_tile, keep_2d=False)
assert out_array.shape == (1, 256, 256)
# Test ma.MaskedArray input
in_data = (ma.MaskedArray(data=np.ones(in_tile.shape[1:])),)
in_data = (
ma.MaskedArray(
data=np.ones(in_tile.shape[1:]),
mask=np.invert(np.ones(in_tile.shape[1:]), dtype="bool", casting="unsafe"),
),
)
out_tile = BufferedTilePyramid("geodetic").tile(6, 10, 10)
out_array = resample_from_array(in_data, in_tile.affine, out_tile)
assert out_array.shape == (1, 256, 256)
Expand Down

0 comments on commit 69a9a70

Please sign in to comment.