Describe the bug
Running pytest xrspatial/geotiff/tests produces 8 failures, all in two files:
test_predictor2_big_endian_gpu_1517.py (7 failures):
AttributeError: <module 'xrspatial.geotiff' ...> has no attribute 'read_to_array'
_block_cpu_fallback does monkeypatch.setattr(geotiff_pkg, 'read_to_array', _no_fallback, raising=True). After PR #1885 moved read_geotiff_gpu into xrspatial/geotiff/_backends/gpu.py, the package no longer exposes read_to_array at that name — __init__.py imports it as _read_to_array, and the actual call site is the _read_to_array symbol inside _backends/gpu.py. The monkeypatch with raising=True therefore aborts the test before the GPU path runs.
test_size_param_validation_gpu_vrt_1776.py::test_tile_size_positive_works:
ValueError: tile_size must be a positive multiple of 16 (TIFF 6 spec
requirement for TileWidth/TileLength), got tile_size=4; try tile_size=16.
The test passes tile_size=4. The validator now requires multiples of 16 (a later change), so the original value is no longer valid. The test's intent (small but valid tile size still works) is fine; only the literal needs updating.
Expected behavior
pytest xrspatial/geotiff/tests should run clean.
Fix
- Patch the call site
xrspatial.geotiff._backends.gpu._read_to_array instead of the no-longer-existing xrspatial.geotiff.read_to_array.
- Change the
tile_size=4 assertion to tile_size=16, the smallest currently valid value, and update the docstring accordingly.
Additional context
CPU and dask tests are unaffected. The failures appear only on GPU-enabled environments (these tests are gated on cupy + CUDA + tifffile).
Describe the bug
Running
pytest xrspatial/geotiff/testsproduces 8 failures, all in two files:test_predictor2_big_endian_gpu_1517.py(7 failures):_block_cpu_fallbackdoesmonkeypatch.setattr(geotiff_pkg, 'read_to_array', _no_fallback, raising=True). After PR #1885 movedread_geotiff_gpuintoxrspatial/geotiff/_backends/gpu.py, the package no longer exposesread_to_arrayat that name —__init__.pyimports it as_read_to_array, and the actual call site is the_read_to_arraysymbol inside_backends/gpu.py. The monkeypatch withraising=Truetherefore aborts the test before the GPU path runs.test_size_param_validation_gpu_vrt_1776.py::test_tile_size_positive_works:The test passes
tile_size=4. The validator now requires multiples of 16 (a later change), so the original value is no longer valid. The test's intent (small but valid tile size still works) is fine; only the literal needs updating.Expected behavior
pytest xrspatial/geotiff/testsshould run clean.Fix
xrspatial.geotiff._backends.gpu._read_to_arrayinstead of the no-longer-existingxrspatial.geotiff.read_to_array.tile_size=4assertion totile_size=16, the smallest currently valid value, and update the docstring accordingly.Additional context
CPU and dask tests are unaffected. The failures appear only on GPU-enabled environments (these tests are gated on cupy + CUDA + tifffile).