expose coordinate padding options in .pad#11213
expose coordinate padding options in .pad#11213ircwaves wants to merge 5 commits intopydata:mainfrom
Conversation
7897bca to
a7ca6d9
Compare
a7ca6d9 to
23b5c4c
Compare
|
@jsignell -- I addressed your comments, and updated the docs. |
|
I didn't follow all the discussion before, but alternatively we could also allow a Mapping from variable/coordinate names to the pad options. This would even allow different pad modes for different coordinates etc. |
|
@headtr1ck writes:
Given that, other than With respect to the coordinate padding options, those only got made a separate set of parameters to handle the implicit functionality which selects a
It feels like we could extend mode: PadModeOptions | Mapping[str, PadModeOptions] | None = NoneI suppose the other bit this brings up is not having separate |
Digging through the backlog with @jsignell, it seems the coord padding with NaN issue comes up every now and again. I've done enough windowed signal processing to know that changing this method's behavior will probably break things for someone, SO this change doesn't break the default type-promotion-and-fill-NaNs behavior. So, I thought I'd put up this PR that extends the change that @TomNicholas suggested as a first draft of what that might look like.
Notes
end_values,constant_values, etc) values for the coord padding parameters in the case where it is inferred from the data paddingmodeparameter.coord_prefixed versions of the data padding parameters.Example runs:
No args
da.pad(x=(5,3)):Or use the new args for linear ramped coordinates (
da.pad(x=(5, 3), constant_values=-1, coord_end_values=(-11,9), coord_mode="linear_ramp")):coord_modein.pad()#6425whats-new.rst[ ] New functions/methods are listed inapi.rst