Add backend statement and Examples section to cost_distance docstring#3642
Merged
Conversation
Melissari1997
commented
Jul 7, 2026
Melissari1997
left a comment
Collaborator
Author
There was a problem hiding this comment.
PR Review: Add backend statement and Examples section to cost_distance docstring
Blockers
None.
Suggestions
None.
Nits
None.
What looks good
- Backend statement matches the phrasing used by
proximity,allocation, anddirectioninproximity.py, and accurately reflects the four backends (numpy, cupy, dask+numpy, dask+cupy) already dispatched incost_distance. - Examples section uses the
.. sourcecode:: pythonconvention, includes runnable>>>blocks with expected output, and is verified by the pin testtest_docstring_example_matches_outputso the printed output cannot drift. - Pin test
test_docstring_states_all_backendsfollows the same pattern as the existing tests intest_proximity.py(from issue #3091) and guards against the old wording coming back. - The new tests pass: both docstring pin and example-output tests succeed alongside the full
test_cost_distance.pysuite (79 passed, 12 skipped). - No behaviour changes, no dispatch or algorithm modifications -- pure doc and test addition.
Checklist
- Algorithm matches reference/paper — N/A (no algorithm change)
- All implemented backends produce consistent results — verified by existing tests
- NaN handling is correct — N/A
- Edge cases are covered by tests — existing coverage is adequate
- Dask chunk boundaries handled correctly — N/A
- No premature materialization or unnecessary copies — N/A
- Benchmark exists or is not needed — N/A (doc-only)
- README feature matrix updated — N/A (no new function)
- Docstrings present and accurate — verified
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3587.
.. sourcecode:: pythonExamples block with a 3x3 uniform-friction exampleTest plan
test_docstring_states_all_backends-- passestest_docstring_example_matches_output-- passestest_cost_distance.pysuite: 79 passed, 12 skipped (GPU-only)