Skip to content

docs(bump): correct height_func contract and count default in docstring#3607

Open
brendancol wants to merge 1 commit into
xarray-contrib:mainfrom
brendancol:deep-sweep-documentation-bump-2026-07-02
Open

docs(bump): correct height_func contract and count default in docstring#3607
brendancol wants to merge 1 commit into
xarray-contrib:mainfrom
brendancol:deep-sweep-documentation-bump-2026-07-02

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Fixes two accuracy problems in the bump() docstring, found during a documentation sweep of the module.

  • height_func was described as taking x, y per point. bump() actually calls it once with a (count, 2) locations array and expects a length-count heights array back. The per-point form raises TypeError when used literally.
  • count was typed int with no default. It is optional and defaults to min(width * height // 10, 10_000_000).

Docstring-only, no behavior change. The runnable example already used the array-based height_func convention, so it needed no edit.

Closes #3606

The height_func Parameters entry described a per-point f(x, y) contract,
but bump() calls height_func(locations) once with a (count, 2) array of
integer (x, y) coordinates and expects a length-count heights array back.
The documented per-point form raises TypeError when used literally.

Also mark count as optional and document its default of
min(width * height // 10, 10_000_000), which was previously unstated.

Docstring-only; no behavior change. Records the doc sweep state for bump.

Refs xarray-contrib#3606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bump() docstring misdescribes the height_func contract

1 participant