Skip to content

Commit 6139e56

Browse files
authored
docs(bump): correct height_func contract and count default in docstring (#3607)
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 #3606
1 parent e75d38a commit 6139e56

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.claude/sweep-documentation-state.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module,last_inspected,issue,severity_max,categories_found,notes,doc_coverage
2+
bump,2026-07-02,#3606,MEDIUM,2;5,"height_func Parameters description gave a per-point f(x,y) contract; actual call is height_func(locations) with a (count,2) array returning a length-count heights array (TypeError on literal use). count typed int with no default; actually Optional, defaults to min(w*h//10, 10_000_000). Docstring plot example executes clean (numpy). Fixed both in PR. LOW-only: no Raises section for MemoryError/ValueError (left documented). CUDA available; cupy/dask+cupy example paths n/a (single .. plot:: is numpy).",1/1
23
classify,2026-06-25,3506,MEDIUM,1;3,"Cat3: reclassify (numpy/dask/cupy blocks) + equal_interval example outputs were stale/wrong, binary used np.nan in array repr; corrected to actual output (tests confirm code is correct). Cat1: added missing Examples to std_mean, head_tail_breaks, percentiles, maximum_breaks, box_plot. Fixed in deep-sweep-documentation-classify-2026-06-25 (PR for #3506). Cat2 natural_breaks num_sample-None omission already tracked in #3501 (left alone). All 10 public funcs listed in reference/classification.rst (no Cat4 gap). CUDA available: ran numpy examples; cupy/dask reprs reviewed statically.",10/10
34
fire,2026-06-25,,MEDIUM,1;5,"all 7 public funcs (dnbr, rdnbr, burn_severity_class, fireline_intensity, flame_length, rate_of_spread, kbdi) lacked Examples section (Cat1 MEDIUM) and backend-support note (Cat5 MEDIUM); fixed in deep-sweep-documentation-fire-2026-06-25-01; repo issues disabled so no issue number; examples run and outputs match numpy backend; all 7 listed in reference/fire.rst; no Cat2/Cat3/Cat4 issues",7/7
45
flood,2026-06-25,,HIGH,1;4;5,"Cat4 HIGH: vegetation_roughness, vegetation_curve_number, flood_depth_vegetation public but absent from reference/flood.rst; Cat1 MEDIUM: no Examples on any of 7 public funcs; Cat5 MEDIUM: backend support undocumented (all 4 backends) + NaN propagation undocumented for curve_number_runoff/travel_time. Fixed in deep-sweep-documentation-flood-2026-06-25: added 3 rst entries, Examples+backend Notes to all 7 funcs (examples executed OK on CUDA host), NaN notes. PR #3502 opened with the fix; gh issue create blocked by auto-mode classifier so no issue number.",7/7

xrspatial/bump.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,14 @@ def bump(width: int = None,
189189
Total height, in pixels, of the image.
190190
Not required when ``agg`` is provided.
191191
count : int, optional
192-
Number of bumps to generate. Defaults to ``width * height // 10``
193-
(capped at 10,000,000) when not provided.
194-
height_func : function which takes x, y and returns a height value
195-
Function used to apply varying bump heights to different
196-
elevations.
192+
Number of bumps to generate. When omitted, defaults to
193+
``min(w * h // 10, 10_000_000)``, where ``w`` and ``h`` are the
194+
output raster width and height (taken from ``agg`` when given).
195+
height_func : callable, optional
196+
Called once as ``height_func(locations)``, where ``locations``
197+
is an ``(count, 2)`` array of integer ``(x, y)`` bump
198+
coordinates. It must return a 1D array of ``count`` bump
199+
heights. When omitted, every bump is given a height of 1.
197200
spread : int, default=1
198201
Number of pixels to spread on all sides.
199202
agg : xarray.DataArray, optional

0 commit comments

Comments
 (0)