Skip to content

cost_distance docstring: no Examples section, backend support unstated #3587

Description

@brendancol

Description

cost_distance is public (exported in xrspatial/__init__.py, listed on docs/source/reference/proximity.rst) but its docstring is missing two things the rest of the proximity family has.

There's no Examples section. The module has no >>> blocks at all, so the rendered API page shows no runnable usage. The other functions on the proximity reference page (proximity, allocation, direction) each end with a .. sourcecode:: python example.

The docstring also never says which backends work. The code dispatches to numpy, cupy, dask+numpy, and dask+cupy, and all four have tests in xrspatial/tests/test_cost_distance.py. proximity/allocation/direction each state "supports NumPy, CuPy, Dask with NumPy, and Dask with CuPy backed xarray DataArray", pinned by test_docstring_states_all_backends (added for #3091). cost_distance has neither the sentence nor a pin.

Proposed change

Doc-only: add an Examples block and a backend-support paragraph to the cost_distance docstring, plus a pin test modeled on the one in test_proximity.py. No behavior changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestseverity:mediumSweep finding: MEDIUM

    Type

    No type

    Fields

    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