Fix incorrect default value for constant_values in DataArray.pad docs#11420
Open
C1-BA-B1-F3 wants to merge 1 commit into
Open
Fix incorrect default value for constant_values in DataArray.pad docs#11420C1-BA-B1-F3 wants to merge 1 commit into
C1-BA-B1-F3 wants to merge 1 commit into
Conversation
The docstring for DataArray.pad incorrectly stated that constant_values defaults to 0. The actual default is None, which results in NaN padding (see Variable.pad implementation). Updated to match the Dataset.pad docstring which already correctly documents this behavior. Fixes pydata#11373
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
Fixes #11373
The docstring for
DataArray.padincorrectly stated thatconstant_valuesdefaults to0. The actual parameter default isNone, which results in NaN padding (not zero). This can be verified inVariable.padwhereconstant_values is Nonetriggersdtypes.maybe_promote()to fill with NaN.Changes
Updated the
constant_valuesparameter documentation inDataArray.pad:default: 0→default: NoneDefault is 0.→Default is ``None``, pads with ``np.nan``.This now matches the
Dataset.paddocstring which already correctly documents this behavior.