bump: add name= parameter and name the output DataArray#3610
Open
brendancol wants to merge 2 commits into
Open
bump: add name= parameter and name the output DataArray#3610brendancol wants to merge 2 commits into
brendancol wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3608.
perlin,worley, andgenerate_terraineach accept anameargument and set it on the returned DataArray.bumpreturned an unnamed DataArray and had nonameparameter, so plot titles and dataset merges that key off.namecame back empty.This adds a keyword-only
name: str = 'bump'parameter and sets it on the output in both the template-aggpath 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
countdocstring, which described a requiredintwhere the parameter isOptional[int] = Nonewith awidth * height // 10default.Not included (breaking, noted in the issue):
aggis keyword-only inbumpbut positional-first in the other generators, sobump(some_dataarray)raises whereperlin(some_dataarray)works. That one needs a deprecation plan of its own.Tests: added
test_bump_names_output_like_siblings. Fullxrspatial/tests/test_bump.pypasses, 19 tests, including the cupy and dask+cupy paths on a GPU host. flake8 clean on the changed lines.