Summary
resample(method='cubic') on dask+numpy or dask+cupy raises
ValueError: The overlapping depth 16 is larger than your array <N>
when the input array is smaller than 16 cells along either axis.
The cubic prefilter depth was raised to 16 in #1464 to drive the IIR
boundary transient below float32 epsilon. _ensure_min_chunksize
enforces min_size = max(2 * depth + 1, ...), so it grows individual
chunks to 33+ cells -- but dask's overlap() still rejects when the
array total is below depth, which happens for an Nx1 column or a
single tiny chunk.
Reproducer
import numpy as np
import dask.array as da
from xrspatial.resample import resample
from xrspatial.tests.general_checks import create_test_raster
data = np.array([[i + 1.0] for i in range(8)], dtype=np.float32)
agg = create_test_raster(data, backend='dask+numpy', dims=['y', 'x'],
attrs={'res': (1.0, 1.0)}, chunks=(2, 1))
resample(agg, scale_factor=0.5, method='cubic')
# ValueError: The overlapping depth 16 is larger than your array 8.
The eager numpy and cupy paths handle this case fine; only the
dask backends fail.
Expected
Either:
- The cubic dask path falls back to a depth small enough for the
array size when the array is too small to absorb depth=16.
- The dask path materialises the small array (sum of
chunks[ax] <
depth) and runs the eager kernel before re-chunking the result.
- The error message is rewritten to point at the documented
minimum-size constraint so users can size their inputs.
Coverage gate
A test in test_resample_coverage_2026_05_27.py::TestSingleColumnRaster::test_nx1_downsample
currently skips this combination. Remove the pytest.skip block once
the fix lands.
Discovered via
/deep-sweep test-coverage on the resample module, 2026-05-27.
Summary
resample(method='cubic')ondask+numpyordask+cupyraisesValueError: The overlapping depth 16 is larger than your array <N>when the input array is smaller than 16 cells along either axis.
The cubic prefilter depth was raised to 16 in #1464 to drive the IIR
boundary transient below float32 epsilon.
_ensure_min_chunksizeenforces
min_size = max(2 * depth + 1, ...), so it grows individualchunks to 33+ cells -- but dask's
overlap()still rejects when thearray total is below
depth, which happens for an Nx1 column or asingle tiny chunk.
Reproducer
The eager
numpyandcupypaths handle this case fine; only thedask backends fail.
Expected
Either:
array size when the array is too small to absorb depth=16.
chunks[ax]<depth) and runs the eager kernel before re-chunking the result.minimum-size constraint so users can size their inputs.
Coverage gate
A test in
test_resample_coverage_2026_05_27.py::TestSingleColumnRaster::test_nx1_downsamplecurrently skips this combination. Remove the
pytest.skipblock oncethe fix lands.
Discovered via
/deep-sweep test-coverageon the resample module, 2026-05-27.