-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pad method #2605
Comments
Has some1 started working on this? I thought I might give it a try ;-) |
@mark-boer - I don't think so. Give it a go! |
@mark-boer Note that we have a |
@dcherian Thx! I found the I have some questions related to this issue, I hope this is the correct place to ask those: Dask added the pad method in version 1.7.0 according to its documentation. What is the minimum version of Dask that should be supported, I found Dask=1.2 is the continuous integration requirements. Also, how should I handle implementation differences between numpy and Dask? E.g. in the current version of Dask and numpy I'm using: |
You can copy over if LooseVersion(dask_version) >= LooseVersion("1.7.0"):
pad = dask.array.pad
else:
# copied from dask.array
def pad(...):
...
That's weird. Open an issue at the dask repo with an example? Feel free to open an in-progress PR. Thanks for working on this. |
Also see #3587 |
I will create a WIP pull request tommorow. |
Hi,
|
Ho, sorry... I just see the PR... |
It would be nice to have a generic
.pad()
method to xarray objects based on numpy.pad and dask.array.pad.In particular,
pad
withmode='wrap'
could solve several use-cases related to periodic boundary conditions: #1005 , #2007. For example,ds.pad(longitude=(0, 1), mode='wrap')
to add an extra point with periodic boundary conditions along thelongitude
dimension.It probably makes sense to linearly extrapolate coordinates along padded dimensions, as long as they are regularly spaced. This might use heuristics and/or a keyword argument.
I don't have a plans to work on this in the near term. It could be a good project of moderate complexity for a new contributor.
The text was updated successfully, but these errors were encountered: