Skip to content

geotiff: extract GPU helpers into _backends/_gpu_helpers.py (#1813 step 6) #1884

Closed

Description

@brendancol

Reason

Six GPU-only helpers live in xrspatial/geotiff/__init__.py (_is_gpu_data L861, _apply_nodata_mask_gpu L878, _gpu_decode_single_band_tiles L2483, _apply_orientation_gpu L2569, _apply_orientation_geo_info L2616, _gpu_apply_window_band L2679). They are leaves of the GPU backend, and lifting them out lets the next PR move read_geotiff_gpu (about 615 lines, the file's largest single function) cleanly without re-extracting helpers mid-flight.

Proposal

Create the _backends/ subpackage (empty __init__.py) and add xrspatial/geotiff/_backends/_gpu_helpers.py with the six helpers above. Lazy-import cupy at call time (mirroring current behaviour) so the module imports on numpy-only environments. Re-import from __init__.py for the still-inline read_geotiff_gpu body.

Refs: #1813.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI design and consistencyenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions