xr-scipy
xr-scipy copied to clipboard
apply_kwargs should be unpacked?
Hello,
I'm working with dask, and I stumbled across the need to specify the dask="parallelized"
argument to xr.apply_ufunc
in frequency_filter
. Currently, there is no way to do that.
One way to do it is to unpack apply_kwargs
. I'm curious what the intent of that variable is.
Before:
ret = xr.apply_ufunc(
sosfiltfilt,
sos,
darray,
input_core_dims=[[], [dim]],
output_core_dims=[[dim]],
kwargs=apply_kwargs,
)
After:
ret = xr.apply_ufunc(
sosfiltfilt,
sos,
darray,
input_core_dims=[[], [dim]],
output_core_dims=[[dim]],
**apply_kwargs,
)
It's all written in https://docs.xarray.dev/en/stable/generated/xarray.apply_ufunc.html :P
The kwargs
are forwarded to the kwargs of the function being applied.
For the dask issue, feel free to open a PR !