issues: 621021621
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
621021621 | MDU6SXNzdWU2MjEwMjE2MjE= | 4078 | Feature request: Implement interp for interpolating between chunks of data (dask) | 1005109 | closed | 0 | 6 | 2020-05-19T14:26:10Z | 2020-08-11T23:15:48Z | 2020-08-11T23:15:48Z | CONTRIBUTOR | In a project of mine I need to interpolate a dask-based xarray between chunk of data. I made it work using monkey patching. I'm pretty sure that you can write it better but I made it as good as I could. I hope that what I wrote can help you implement it properly. ```python from typing import Union, Tuple, Callable, Any, List import dask.array as da import numpy as np import xarray as xr import xarray.core.missing as m def interp_func(var: Union[np.ndarray, da.Array], x: Tuple[xr.DataArray, ...], new_x: Tuple[xr.DataArray, ...], method: str, kwargs: Any) -> da.Array: """ multi-dimensional interpolation for array-like. Interpolated axes should be located in the last position.
def _myinterpnd(var: da.Array, func: Callable[..., Any], kwargs: Any, nx: int, *arrs: da.Array) -> da.Array: _old_x, _new_x = arrs[:nx], arrs[nx:]
official_interp_func = m.interp_func m.interp_func = interp_func ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/4078/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |