[rasterio] numpy arrays in transform.xy, a crs of None, and read(masked=True)
Maintainer antworten meist innerhalb von 1 Tag
@omkhpb25 arbeitet bereits daran.
Seit 21.10.2026.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
The three problems are in the rasterio stubs bundled in typeshed: rasterio.transform.xy (the rows/cols parameters and return type), DatasetBase.crs, and DatasetReaderBase.read (the return type when masked=True). Reproduce each case with the snippets in the issue, then compare against the current stub signatures. Done means the stubs accept numpy arrays, allow crs to be None, and return a masked array type when masked=True, with the repository's stub tests passing. The issue asks for maintainer approval before a pull request, so confirm that first.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Researched and drafted by Claude (Anthropic's AI model, in Claude Code), which also ran the measurements below; reviewed by @bjlittle before posting.
Type checking geovista against types-rasterio 1.5.2.20261005 turned up three places where the rasterio stubs are narrower than rasterio 1.5.2 at runtime.
-
rasterio.transform.xytypesrowsandcolsasint | Sequence[int], and its result astuple[float, float] | tuple[list[float], list[float]].rasteriotakes numpy arrays, and gives arrays back for them:import numpy as np from rasterio.transform import from_origin, xy transform = from_origin(10.0, 20.0, 1.0, 1.0) rows, cols = np.meshgrid(np.arange(2), np.arange(3), indexing="ij") xs, ys = xy(transform, rows.flatten(), cols.flatten()) type(xs) # <class 'numpy.ndarray'>An
ndarrayis not aSequence, so a caller passing one needs a cast. -
DatasetBase.crsis typedCRS, but a GeoTIFF without a CRS givesNone. -
DatasetReaderBase.readis typed to returnNDArray[Any]whatevermaskedis, but withmasked=Trueit returns anumpy.ma.MaskedArray, so using itsmaskdoesn't type check.
If any of these would be welcome as a pull request, Claude can prepare one the same way, for @bjlittle to review before it is opened.
🤖 Generated with Claude Code
- Vorherrschende Sprache
- Python
- Sterne
- 5.1k
- Forks
- 2.1k
- Ø Merge
- 2 T. 7 Min.
- Gemergte PRs (30 T.)
- 116
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python/typeshed
-
`networkx.set_edge_attributes` should support scalar value + nameEvtl. vergeben @Fire162 hat das vor 8 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
Maintainer antworten meist innerhalb von 1 Tag
-
false alarm on decode callEvtl. vergeben @jw9829 hat das vor 36 Tagen übernommen. Offenhelp wanted stubs: false positive
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
python/typeshed#16441 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Don't run pyright basic checks on projects with strict pyright settings in CIEvtl. vergeben @Mohith1612 hat das vor 73 Tagen übernommen. Offenproject: infrastructure
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
python/typeshed#16005 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
stubs: improvement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
python/typeshed#15548 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
stubs: improvement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
python/typeshed#15529 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in python/typeshed
Ähnliche Issues
-
URLValidator ignores an explicit empty scheme allowlistEvtl. vergeben @IlyaKhalafi hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
tortoise/tortoise-orm#2393 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
frappe/frappe_docker#2046 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Weekly link check failedOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
complete_box_iou_loss / complete_box_iou: NaN gradients for zero-height boxes, NaN for point boxesOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
AXI SMU SPEC
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
tenstorrent/tt-oca-harness#3556 ·
Maintainer antworten meist innerhalb von 1 Tag