Skip to content

Commit

Permalink
Catch re-chunking warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed Dec 12, 2023
1 parent a7f93eb commit 5f00f09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion satpy/tests/test_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,12 @@ def test_expand_reduce_agg_rechunk(self):
into that chunk size.
"""
from satpy.utils import PerformanceWarning

d_arr = da.zeros((6, 20), chunks=3)
new_data = NativeResampler._expand_reduce(d_arr, {0: 0.5, 1: 0.5})
text = "Array chunk size is not divisible by aggregation factor. Re-chunking to continue native resampling."
with pytest.warns(PerformanceWarning, match=text):
new_data = NativeResampler._expand_reduce(d_arr, {0: 0.5, 1: 0.5})
assert new_data.shape == (3, 10)

def test_expand_reduce_numpy(self):
Expand Down

0 comments on commit 5f00f09

Please sign in to comment.