home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 347662610

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
347662610 MDU6SXNzdWUzNDc2NjI2MTA= 2341 apply_ufunc silently neglects arguments if `len(input_core_dims) < args` 6815844 closed 0     1 2018-08-05T02:16:00Z 2018-08-06T22:38:53Z 2018-08-06T22:38:53Z MEMBER      

From SO

In the following script, the second argument is silently neglected, python 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,

https://github.com/pydata/xarray/blob/56381ef444c5e699443e8b4e08611060ad5c9507/xarray/core/computation.py#L535-L538

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.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2341/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.614ms · About: xarray-datasette