Summary
Follow-up under epic #2211. Phase 5e deliverable: extract overview-building helpers (pyramid generation for COGs) out of _writer.py into a new _overview.py.
Scope
Mechanical extraction. Behavior-neutral. Touches _writer.py only — runs cleanly in parallel with PR-J (which touches _reader.py).
Files
- Create:
xrspatial/geotiff/_overview.py.
- Modify:
xrspatial/geotiff/_writer.py — remove the helpers being moved; import them from _overview.
- Modify: any importers (likely
_writers/eager.py, _writers/gpu.py, _writers/vrt.py).
What to move
Overview-building helpers in _writer.py (verify each name in the current file):
_make_overview
_replicate_pad_2d
_block_reduce_2d
_resolve_int_nodata (only if it is overview-scoped; otherwise leave it)
_validate_overview_levels
Leave in _writer.py: strip/tile encode helpers, photometric/predictor encode helpers, _write / _write_streaming orchestration, _compress_block, _validate_lowlevel_write_kwargs, fsspec write helpers.
Acceptance
_writer.py line count drops by ~400–460 lines.
- All overview/COG tests pass unchanged:
test_cog_overview_*.py, test_overview_*.py, test_block_reduce_*.py, test_resample_*.py, plus the broader geotiff write suite.
- Public import paths preserved.
- No public API change.
Non-goals
- Splitting strip/tile encode out (that is PR-L, held until this PR merges).
- Performance work.
Closes part of #2211.
Summary
Follow-up under epic #2211. Phase 5e deliverable: extract overview-building helpers (pyramid generation for COGs) out of
_writer.pyinto a new_overview.py.Scope
Mechanical extraction. Behavior-neutral. Touches
_writer.pyonly — runs cleanly in parallel with PR-J (which touches_reader.py).Files
xrspatial/geotiff/_overview.py.xrspatial/geotiff/_writer.py— remove the helpers being moved; import them from_overview._writers/eager.py,_writers/gpu.py,_writers/vrt.py).What to move
Overview-building helpers in
_writer.py(verify each name in the current file):_make_overview_replicate_pad_2d_block_reduce_2d_resolve_int_nodata(only if it is overview-scoped; otherwise leave it)_validate_overview_levelsLeave in
_writer.py: strip/tile encode helpers, photometric/predictor encode helpers,_write/_write_streamingorchestration,_compress_block,_validate_lowlevel_write_kwargs, fsspec write helpers.Acceptance
_writer.pyline count drops by ~400–460 lines.test_cog_overview_*.py,test_overview_*.py,test_block_reduce_*.py,test_resample_*.py, plus the broader geotiff write suite.Non-goals
Closes part of #2211.