You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reproject() has five execution paths: in-memory numpy, in-memory cupy, dask, dask+cupy, and a streaming fallback that kicks in when the source is over 512 MB and dask can't be imported. The first four are covered in test_reproject.py. Nothing runs the streaming one: _reproject_streaming, _process_tile_batch, and _parse_max_memory (xrspatial/reproject/__init__.py) never execute under pytest.
The path has its own tile-job construction, a ThreadPoolExecutor batching loop with a serial fallback, mosaic assembly from (row_offset, col_offset, tile) triples, and the max_memory parser. An off-by-one in the assembly offsets, or a parser regression, would not turn any test red.
The existing max_memory tests (test_reproject_max_memory_string_arg / test_reproject_max_memory_int_arg) push a 32x32 raster through reproject(), which stays on the in-memory path. _parse_max_memory only runs when the streaming branch is selected, so those tests never reach it.
Proposed tests (test-only):
Call _reproject_streaming directly on a small raster and compare against the in-memory numpy output for the same grid: multi-tile threaded run, serial run (max_memory small enough to disable the thread pool), single-tile run.
_parse_max_memory unit cases: None default, KB/MB/GB/TB suffixes, int passthrough, bare numeric string.
reproject()has five execution paths: in-memory numpy, in-memory cupy, dask, dask+cupy, and a streaming fallback that kicks in when the source is over 512 MB and dask can't be imported. The first four are covered in test_reproject.py. Nothing runs the streaming one:_reproject_streaming,_process_tile_batch, and_parse_max_memory(xrspatial/reproject/__init__.py) never execute under pytest.The path has its own tile-job construction, a ThreadPoolExecutor batching loop with a serial fallback, mosaic assembly from
(row_offset, col_offset, tile)triples, and the max_memory parser. An off-by-one in the assembly offsets, or a parser regression, would not turn any test red.The existing max_memory tests (
test_reproject_max_memory_string_arg/test_reproject_max_memory_int_arg) push a 32x32 raster throughreproject(), which stays on the in-memory path._parse_max_memoryonly runs when the streaming branch is selected, so those tests never reach it.Proposed tests (test-only):
_reproject_streamingdirectly on a small raster and compare against the in-memory numpy output for the same grid: multi-tile threaded run, serial run (max_memory small enough to disable the thread pool), single-tile run._parse_max_memoryunit cases: None default, KB/MB/GB/TB suffixes, int passthrough, bare numeric string.I checked locally: the 2-D streaming output matches the in-memory result, so this is a coverage gap rather than a behaviour bug.