From 7eae580132cbbf07ca630e3cbe12c5e923223f6d Mon Sep 17 00:00:00 2001 From: Brendan Collins Date: Thu, 2 Jul 2026 11:43:21 -0400 Subject: [PATCH] docs(bump): correct height_func contract and count default in docstring 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 --- .claude/sweep-documentation-state.csv | 1 + xrspatial/bump.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.claude/sweep-documentation-state.csv b/.claude/sweep-documentation-state.csv index 84fe31d0c..de401a686 100644 --- a/.claude/sweep-documentation-state.csv +++ b/.claude/sweep-documentation-state.csv @@ -1,4 +1,5 @@ module,last_inspected,issue,severity_max,categories_found,notes,doc_coverage +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 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 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 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 diff --git a/xrspatial/bump.py b/xrspatial/bump.py index c7518b461..76fd59db0 100644 --- a/xrspatial/bump.py +++ b/xrspatial/bump.py @@ -180,11 +180,14 @@ def bump(width: int = None, height : int, optional Total height, in pixels, of the image. Not required when ``agg`` is provided. - count : int - Number of bumps to generate. - height_func : function which takes x, y and returns a height value - Function used to apply varying bump heights to different - elevations. + count : int, optional + Number of bumps to generate. When omitted, defaults to + ``min(width * height // 10, 10_000_000)``. + height_func : callable, optional + Called once as ``height_func(locations)``, where ``locations`` + is an ``(count, 2)`` array of integer ``(x, y)`` bump + coordinates. It must return a 1D array of ``count`` bump + heights. When omitted, every bump is given a height of 1. spread : int, default=1 Number of pixels to spread on all sides. agg : xarray.DataArray, optional