Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .claude/sweep-documentation-state.csv
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions xrspatial/perlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading