The synthetic-terrain generators share an output convention: perlin, worley, and generate_terrain each take a name argument and set it on the returned DataArray. bump does not. It returns an unnamed DataArray and has no name parameter.
import numpy as np, xarray as xr
from xrspatial.bump import bump
from xrspatial.perlin import perlin
from xrspatial.worley import worley
from xrspatial.terrain import generate_terrain
agg = xr.DataArray(np.zeros((10, 10)), dims=['y', 'x'])
print(perlin(agg.copy()).name) # 'perlin'
print(worley(agg.copy()).name) # 'worley'
print(generate_terrain(agg.copy()).name) # 'terrain'
np.random.seed(0)
print(bump(agg=agg.copy()).name) # None
Someone who passes name= to the other generators finds the argument missing on bump, and anything that keys off .name (plot titles, dataset merges) comes back empty.
One more thing I noticed in the signature: the count docstring lists it as a required int, but the parameter is Optional[int] = None with a computed default of width * height // 10 (capped at 10M). The docstring should say so.
Proposed fix, non-breaking: add a keyword-only name: str = 'bump' parameter and set it on the returned DataArray in both the agg and width/height paths, and correct the count docstring.
Not covered here because it is breaking: agg is keyword-only in bump but positional-first in the sibling generators, so bump(some_dataarray) raises where perlin(some_dataarray) works. Making agg positional would break the historical bump(width, height) call, so it needs its own deprecation plan.
Found by the api-consistency deep-sweep, 2026-07-02.
The synthetic-terrain generators share an output convention:
perlin,worley, andgenerate_terraineach take anameargument and set it on the returned DataArray.bumpdoes not. It returns an unnamed DataArray and has nonameparameter.Someone who passes
name=to the other generators finds the argument missing onbump, and anything that keys off.name(plot titles, dataset merges) comes back empty.One more thing I noticed in the signature: the
countdocstring lists it as a requiredint, but the parameter isOptional[int] = Nonewith a computed default ofwidth * height // 10(capped at 10M). The docstring should say so.Proposed fix, non-breaking: add a keyword-only
name: str = 'bump'parameter and set it on the returned DataArray in both theaggand width/height paths, and correct thecountdocstring.Not covered here because it is breaking:
aggis keyword-only inbumpbut positional-first in the sibling generators, sobump(some_dataarray)raises whereperlin(some_dataarray)works. Makingaggpositional would break the historicalbump(width, height)call, so it needs its own deprecation plan.Found by the api-consistency deep-sweep, 2026-07-02.