Commit 72aea74
committed
Annotate open_geotiff(source) as str | BinaryIO (#1754)
The api-consistency sweep on 2026-05-12 found a parameter-annotation
gap on open_geotiff(source): the docstring documents "str or binary
file-like" and the runtime accepts BytesIO, but the signature has no
annotation. Sibling reader functions (read_geotiff_gpu,
read_geotiff_dask, read_vrt) all annotate source: str because they
reject file-like sources. The writer entry points (to_geotiff,
write_geotiff_gpu) carry path: str | BinaryIO for the same
file-like-or-string surface that open_geotiff exposes.
PR #1654 annotated window, path, and on_gpu_failure across the public
geotiff surface but missed source on open_geotiff. This PR closes that
gap.
test_signature_annotations_1654.py picks up four new pins:
- open_geotiff(source) must accept both str and BinaryIO
- read_geotiff_dask, read_geotiff_gpu, read_vrt stay str-only
- a runtime smoke test that a BytesIO buffer round-trips through
open_geotiff
Annotation-only change; no runtime behaviour, no defaults, no kwarg
renames. BinaryIO is already imported under TYPE_CHECKING in
xrspatial/geotiff/__init__.py from PR #1654.
Also updates the api-consistency sweep state CSV with the v3 row for
geotiff.1 parent e7b9cde commit 72aea74
3 files changed
Lines changed: 63 additions & 2 deletions
File tree
- .claude
- xrspatial/geotiff
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
644 | | - | |
| 644 | + | |
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
92 | 126 | | |
93 | 127 | | |
94 | 128 | | |
| |||
129 | 163 | | |
130 | 164 | | |
131 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
0 commit comments