We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
len(input_core_dims) < args
From SO
In the following script, the second argument is silently neglected,
da = xr.DataArray(np.random.randn(4, 3), coords={'x': [5, 7, 9, 11]}, dims=('x', 'y')) xr.apply_ufunc(np.gradient, da, da.coords['x'].values, kwargs={'axis': -1}, input_core_dims=[['x']], output_core_dims=[['x']], output_dtypes=[da.dtype])
This is because we need to the same number of input_core_dims to the number of arguments,
input_core_dims
xarray/xarray/core/computation.py
Lines 535 to 538 in 56381ef
The correct scipt might be input_core_dims=[['x']] -> input_core_dims=[['x'], []].
input_core_dims=[['x']]
input_core_dims=[['x'], []]
I think we can raise a more friendly error if the size of input_core_dims are wrong.
EDIT: Or we can automatically insert an empty tuple or None for non-xarray object? input_core_dims for non-xarray object sounds a little strange.
None
The text was updated successfully, but these errors were encountered:
👍 we should definitely raise an informative error message here rather than silently dropping the argument in zip.
zip
Sorry, something went wrong.
Fixes pydata#2341
ca56614
apply_ufunc now raises a ValueError when the size of input_core_dims …
0b18122
…is inconsistent with number of argument (#2342) * Fixes #2341 * commit forgotten files. * Avoid using np.gradient * if -> elif
No branches or pull requests
From SO
In the following script, the second argument is silently neglected,
This is because we need to the same number of
input_core_dims
to the number of arguments,xarray/xarray/core/computation.py
Lines 535 to 538 in 56381ef
The correct scipt might be
input_core_dims=[['x']]
->input_core_dims=[['x'], []]
.I think we can raise a more friendly error if the size of
input_core_dims
are wrong.EDIT:
Or we can automatically insert an empty tuple or
None
for non-xarray object?input_core_dims
for non-xarray object sounds a little strange.The text was updated successfully, but these errors were encountered: