[rasterio] numpy arrays in transform.xy, a crs of None, and read(masked=True)
Mantenedores costumam responder em até 1 dia
@omkhpb25 já está trabalhando nisso.
Desde 21/10/2026.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 45/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 5.1k
- Forks
- 2.1k
- Merge médio
- 2d 1h
- PRs com merge (30d)
- 115
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python/typeshed
-
`networkx.set_edge_attributes` should support scalar value + nameTalvez já em andamento @Fire162 assumiu há 10 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
Mantenedores costumam responder em até 1 dia
-
false alarm on decode callTalvez já em andamento @jw9829 assumiu há 37 dias. Abertahelp wanted stubs: false positive
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
python/typeshed#16441 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Don't run pyright basic checks on projects with strict pyright settings in CITalvez já em andamento @Mohith1612 assumiu há 74 dias. Abertaproject: infrastructure
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
python/typeshed#16005 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
stubs: improvement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python/typeshed#15548 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
-
stubs: improvement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
python/typeshed#15529 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de python/typeshed
Issues semelhantes
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesAbertafollow-up
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
Built-in QUBO fallback applies bitwise xor to floating binary statesTalvez já em andamento @iloveeyjafjalla assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
qboson/kaiwu-pytorch-plugin#1702 ·
Mantenedores costumam responder em até 3 dias
-
bug v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
modelcontextprotocol/python-sdk#3811 ·
Mantenedores costumam responder em até 1 dia
-
cost:cheap practicality:seen-in-the-wild severity:medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
Mantenedores costumam responder em até 1 dia