Skip to content

geotiff: extract writer entry points into _writers/ and reduce __init__.py to dispatch only (#1813 step 10) #1888

Closed

Description

@brendancol

Reason

With the four read backends extracted (#1813 steps 7–9), __init__.py still holds to_geotiff (L1143), _write_single_tile (L1691), _write_vrt_tiled (L1757), write_geotiff_gpu (L3338), and write_vrt (L4417). Together that is about 1700 lines of writer logic. Splitting them mirrors the reader layout and reduces __init__.py to a thin dispatch file (about 150 lines: docstring, __all__, re-imports, open_geotiff body, deprecated plot_geotiff shim).

Proposal

Create _writers/eager.py (to_geotiff + private helpers), _writers/gpu.py (write_geotiff_gpu), _writers/vrt.py (write_vrt). Re-export the public names from __init__.py. The #1813 parity matrix uses to_geotiff as its fixture builder, so any writer regression breaks every parity cell, which is a strong backstop.

Drawbacks

Last and biggest writer-side change; reviewer needs to verify the writer bodies are unchanged except for imports. Mitigated by parity matrix and the existing writer test suite (test_features.py, test_compression*.py, test_writer_*.py).

Refs: #1813.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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