Description
In xrspatial/proximity.py, the three public functions share the same signature and return the same type, but their return annotations don't match:
proximity is annotated -> xr.DataArray
allocation has no return annotation
direction has no return annotation
All three build their result with xr.DataArray(...) and carry @supports_dataset, so they return a DataArray (or a Dataset when handed a Dataset). The docstrings already document the return type, so the annotation on allocation and direction is just missing.
Proposed change
Add -> xr.DataArray to allocation and direction to match proximity. Annotation only: no behavior, signature, or default changes, so nothing breaks and no deprecation shim is needed.
Found by
API-consistency sweep over the proximity module (Cat 3: type hints).
Description
In
xrspatial/proximity.py, the three public functions share the same signature and return the same type, but their return annotations don't match:proximityis annotated-> xr.DataArrayallocationhas no return annotationdirectionhas no return annotationAll three build their result with
xr.DataArray(...)and carry@supports_dataset, so they return a DataArray (or a Dataset when handed a Dataset). The docstrings already document the return type, so the annotation onallocationanddirectionis just missing.Proposed change
Add
-> xr.DataArraytoallocationanddirectionto matchproximity. Annotation only: no behavior, signature, or default changes, so nothing breaks and no deprecation shim is needed.Found by
API-consistency sweep over the proximity module (Cat 3: type hints).