Expose geotiff public functions in __all__ and warn on plot_geotiff#1544
Open
brendancol wants to merge 1 commit intomainfrom
Open
Expose geotiff public functions in __all__ and warn on plot_geotiff#1544brendancol wants to merge 1 commit intomainfrom
brendancol wants to merge 1 commit intomainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
read_geotiff_gpu,read_geotiff_dask,read_vrt, andwrite_geotiff_gputoxrspatial.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 andfrom xrspatial.geotiff import *silently skipped them.DeprecationWarningtoplot_geotiff. The docstring already said "deprecated" but the function emitted no runtime warning, so callers only learned about the deprecation by reading source.TestPublicAPIclass that pins the__all__set, verifiesfrom ... import *brings each name in, and assertsplot_geotiffstays 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, thedata/dask_datarename in_writer, defaultchunksdrift, 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 ontest_xrs_plot_*andtest_plot_geotiff_deprecatedreproduce onmain(Python 3.14 + pyparsing). Not introduced here. Otherwise 121 passed (was 118 on main).