Skip to content

proximity: add missing return annotations to allocation and direction #2717

@brendancol

Description

@brendancol

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI design and consistencyenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions