diff --git a/.claude/sweep-documentation-state.csv b/.claude/sweep-documentation-state.csv new file mode 100644 index 000000000..7c342d626 --- /dev/null +++ b/.claude/sweep-documentation-state.csv @@ -0,0 +1,2 @@ +module,last_inspected,issue,severity_max,categories_found,notes,doc_coverage +perlin,2026-06-23,,MEDIUM,2;5,"name param undocumented (Cat2) + float-dtype requirement/ValueError undocumented, no Raises section (Cat5); fixed in deep-sweep-documentation-perlin-2026-06-23; repo has issues disabled so no issue number; example runs and output matches; 1 public func (perlin) listed in reference/surface.rst",1/1 diff --git a/xrspatial/perlin.py b/xrspatial/perlin.py index fe08cff8c..5beebb2ff 100644 --- a/xrspatial/perlin.py +++ b/xrspatial/perlin.py @@ -294,16 +294,28 @@ def perlin(agg: xr.DataArray, agg : xr.DataArray 2D array of size width x height, will be used to determine height/ width and which platform to use for calculation. + Must have a floating-point dtype (float32 or float64); integer + input is rejected (see Raises). freq : tuple, default=(1,1) (x, y) frequency multipliers. seed : int, default=5 Seed for random number generator. + name : str, default='perlin' + Name assigned to the output DataArray. Returns ------- perlin_agg : xarray.DataArray 2D array of perlin noise values. + Raises + ------ + ValueError + If `agg` does not have a floating-point dtype. The noise is + written into `agg` in place and then normalized; an integer + buffer would truncate the float values to zero and corrupt the + result, so non-float input is rejected up front. + References ---------- - Paul Panzer: https://stackoverflow.com/questions/42147776/producing-2d-perlin-noise-with-numpy # noqa