Skip to content

Add Examples section to to_geotiff docstring#3521

Merged
brendancol merged 2 commits into
mainfrom
deep-sweep-documentation-geotiff-2026-06-25
Jun 26, 2026
Merged

Add Examples section to to_geotiff docstring#3521
brendancol merged 2 commits into
mainfrom
deep-sweep-documentation-geotiff-2026-06-25

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

What

Adds an Examples section to the to_geotiff docstring.

Why

open_geotiff has an Examples section with copy-pasteable usage. to_geotiff, the matching write entry point, documented Parameters, Returns, and Raises but had no Examples. That was the one structural docstring gap a documentation sweep of the geotiff module turned up; everything else (signature/docstring parity, reference-page coverage, tier claims) is already locked by tests.

What changed

A numpydoc Examples block with three >>> ... # doctest: +SKIP snippets, following the open_geotiff block and the writing examples already in docs/source/reference/geotiff.rst:

  • plain GeoTIFF write then read back
  • cog=True Cloud Optimized GeoTIFF write
  • .vrt mosaic write

Docs only. No behavior change, no signature change. test_polish.py and test_to_geotiff_parameters_match_signature_1683 pass.

open_geotiff has an Examples section; to_geotiff did not, even
though it's the matching write entry point and already documents
Parameters, Returns, and Raises. Add a numpydoc Examples block with
+SKIP doctest snippets for a plain GeoTIFF write/read, a cog=True
write, and a .vrt mosaic write, following the open_geotiff block and
the writing examples in docs/source/reference/geotiff.rst.

Docs only, no behavior change. Found by the documentation deep-sweep
of the geotiff module.
@brendancol

Copy link
Copy Markdown
Contributor Author

PR Review: Add Examples section to to_geotiff docstring

Reviewed from the head-branch worktree. Docs-only change: an Examples block on the to_geotiff docstring plus one row in the sweep state CSV. No code paths, signatures, or behavior touched.

Blockers

None.

Suggestions

None.

Nits

  • The import line >>> from xrspatial.geotiff import open_geotiff, to_geotiff has no # doctest: +SKIP while the calls under it do. That matches the existing open_geotiff block exactly and the import is valid, so it's fine. Worth knowing for later: if the repo ever turns on --doctest-modules, the import runs (and passes) and the +SKIP calls are skipped. Doctests don't run on modules today.

What looks good

  • All four example calls hit the real API: to_geotiff(data, path), to_geotiff(data, path, cog=True), to_geotiff(data, 'mosaic.vrt'), open_geotiff(path). Both functions are in __all__.
  • The cog=True note ("tiled, with internal overviews") and the .vrt note ("tiles the array and emits the index that references the tiles") agree with the rest of the docstring and with docs/source/reference/geotiff.rst.
  • +SKIP usage and style copy the open_geotiff block, which was the stated model. data is an undefined placeholder, but every line that uses it is +SKIP, so doctest collection is unaffected, same as the open_geotiff block.

Checklist

  • Algorithm / backend parity / NaN / dask boundaries / materialization: n/a (docs only)
  • Benchmark: not needed
  • README feature matrix: n/a (function already present)
  • Docstrings present and accurate: yes

Verdict: no actionable changes. Accurate and consistent with the existing open_geotiff docstring. test_polish.py and test_to_geotiff_parameters_match_signature_1683 pass.

# Conflicts:
#	.claude/sweep-documentation-state.csv
@brendancol brendancol merged commit 51022cf into main Jun 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant