Summary
xrspatial.rasterize.rasterize annotates 13 of 16 parameters plus the return type. Three are missing: geometries, columns, merge. The docstring already states the intended types, so the signature trails the docs:
geometries: "GeoDataFrame or iterable of (geometry, value)"
columns: "list of str, optional"
merge: "str or callable, default 'last'"
Proposed fix
Add annotations matching the docstring. polygonize already annotates every public parameter, so this brings rasterize in line.
Union[str, Callable] is enough for merge. Spelling out Callable[[float, np.ndarray, int], float] is more precise but not needed on the public surface.
No behaviour change. No deprecation needed.
Sweep context
Found by /sweep-api-consistency on 2026-05-21. Cat 3 (type hints / docstring), MEDIUM.
The same sweep noted cross-module drifts that are out of scope here (per template rules they get documented, not filed per module):
clip_polygon(nodata=...) vs rasterize(fill=...) for the same concept.
clip_polygon(name: Optional[str] = None) vs rasterize(name: str = 'rasterize') for default-resolution convention.
polygonize(column_name=...) vs rasterize(column=...) for the column selector.
Summary
xrspatial.rasterize.rasterizeannotates 13 of 16 parameters plus the return type. Three are missing:geometries,columns,merge. The docstring already states the intended types, so the signature trails the docs:geometries: "GeoDataFrame or iterable of (geometry, value)"columns: "list of str, optional"merge: "str or callable, default 'last'"Proposed fix
Add annotations matching the docstring.
polygonizealready annotates every public parameter, so this bringsrasterizein line.Union[str, Callable]is enough formerge. Spelling outCallable[[float, np.ndarray, int], float]is more precise but not needed on the public surface.No behaviour change. No deprecation needed.
Sweep context
Found by
/sweep-api-consistencyon 2026-05-21. Cat 3 (type hints / docstring), MEDIUM.The same sweep noted cross-module drifts that are out of scope here (per template rules they get documented, not filed per module):
clip_polygon(nodata=...)vsrasterize(fill=...)for the same concept.clip_polygon(name: Optional[str] = None)vsrasterize(name: str = 'rasterize')for default-resolution convention.polygonize(column_name=...)vsrasterize(column=...)for the column selector.