Skip to content

bump: add name= parameter and name the output DataArray#3610

Open
brendancol wants to merge 2 commits into
xarray-contrib:mainfrom
brendancol:deep-sweep-api-consistency-bump-2026-07-02
Open

bump: add name= parameter and name the output DataArray#3610
brendancol wants to merge 2 commits into
xarray-contrib:mainfrom
brendancol:deep-sweep-api-consistency-bump-2026-07-02

Conversation

@brendancol

Copy link
Copy Markdown
Contributor

Closes #3608.

perlin, worley, and generate_terrain each accept a name argument and set it on the returned DataArray. bump returned an unnamed DataArray and had no name parameter, so plot titles and dataset merges that key off .name came back empty.

This adds a keyword-only name: str = 'bump' parameter and sets it on the output in both the template-agg path and the width/height path. The parameter is keyword-only with a default, so existing positional calls are unaffected.

While in the signature, I also corrected the count docstring, which described a required int where the parameter is Optional[int] = None with a width * height // 10 default.

Not included (breaking, noted in the issue): agg is keyword-only in bump but positional-first in the other generators, so bump(some_dataarray) raises where perlin(some_dataarray) works. That one needs a deprecation plan of its own.

Tests: added test_bump_names_output_like_siblings. Full xrspatial/tests/test_bump.py passes, 19 tests, including the cupy and dask+cupy paths on a GPU host. flake8 clean on the changed lines.

…ib#3608)

perlin, worley, and generate_terrain all accept a name argument and set it
on the returned DataArray. bump did not: it returned an unnamed DataArray
with no name parameter. Add a keyword-only name='bump' parameter and set it
on the output in both the agg and width/height paths.

Also correct the count docstring, which described a required int where the
signature is Optional[int]=None with a width*height//10 default.

The parameter is keyword-only with a default, so existing positional calls
are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bump() returns an unnamed DataArray and has no name= parameter, unlike perlin/worley/generate_terrain

1 participant