Skip to content

Expose geotiff public functions in __all__ and warn on plot_geotiff#1544

Open
brendancol wants to merge 1 commit intomainfrom
geotiff-public-api-all-1541
Open

Expose geotiff public functions in __all__ and warn on plot_geotiff#1544
brendancol wants to merge 1 commit intomainfrom
geotiff-public-api-all-1541

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

  • Add read_geotiff_gpu, read_geotiff_dask, read_vrt, and write_geotiff_gpu to xrspatial.geotiff.__all__. They were imported by 9, 5, indirect, and 1 test files respectively but missing from the public API surface, so they had no stability contract and from xrspatial.geotiff import * silently skipped them.
  • Add a real DeprecationWarning to plot_geotiff. The docstring already said "deprecated" but the function emitted no runtime warning, so callers only learned about the deprecation by reading source.
  • Refresh the module docstring's "Public API" block to list every supported entry point.
  • Add a TestPublicAPI class that pins the __all__ set, verifies from ... import * brings each name in, and asserts plot_geotiff stays importable but out of __all__.

Closes #1541

Context

First finding from the geotiff API consistency sweep. Remaining items (gpu kwarg type drift across open_geotiff/to_geotiff/read_geotiff_gpu/read_vrt, sibling-function param asymmetry, the data/dask_data rename in _writer, default chunks drift, and a stale compression list in _writer.write's docstring) are listed in #1541 for follow-up PRs so each fix lands on its own.

Test plan

  • pytest xrspatial/geotiff/tests/ --ignore=xrspatial/geotiff/tests/test_features.py -- 818 passed, 2 skipped.
  • pytest xrspatial/geotiff/tests/test_features.py::TestPublicAPI -- 3 new tests passing.
  • pytest xrspatial/geotiff/tests/test_features.py -- pre-existing matplotlib-recursion failures on test_xrs_plot_* and test_plot_geotiff_deprecated reproduce on main (Python 3.14 + pyparsing). Not introduced here. Otherwise 121 passed (was 118 on main).

read_geotiff_gpu, read_geotiff_dask, read_vrt, and write_geotiff_gpu were
imported by 9, 5, indirect, and 1 test files respectively but were not
listed in __all__, leaving them as orphan public functions: importable
but with no stability contract and silently skipped by `from
xrspatial.geotiff import *`.

Add the four to __all__ and refresh the module docstring so the public
API surface matches what callers already rely on. plot_geotiff stays
out of __all__ since it is deprecated, but now emits a real
DeprecationWarning instead of only documenting the deprecation in its
docstring.

Closes #1541
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

geotiff: orphan public functions missing from __all__

1 participant