docs: correct DataArray.pad constant_values default in docstring#11375
Open
mvanhorn wants to merge 1 commit into
Open
docs: correct DataArray.pad constant_values default in docstring#11375mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
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.
Summary
Corrects the
DataArray.paddocstring so the documentedconstant_valuesdefault matches the real signature and agrees withDataset.pad.Why
The
DataArray.paddocstring documentedconstant_valuesasdefault: 0, but the signature actually defaults toNone, which forwards toDataset.padand pads withnp.nan. Issue #11373 reports this as misleading: a user reading the docstring expects zero-padding and gets NaN, and the two methods' docs disagree.Description
The
DataArray.paddocstring inxarray/core/dataarray.pydocumentedconstant_valuesasdefault: 0, but the actual signature defaults toNone, which forwards toDataset.padand pads withnp.nan(asDataset.pad's own docstring already states). Issue #11373 reports this mismatch as misleading. This corrects the documented default toNoneand aligns the prose withDataset.pad("Default isNone, pads withnp.nan"), so the two methods agree. Docstring only, no behavior change.Checklist
whats-new.rstapi.rstAI Disclosure
Tools: Claude (Claude Code). Prompt: correct the
DataArray.padconstant_valuesdocstring default from0toNoneto match the signature andDataset.pad.