home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 371355899

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/1962#issuecomment-371355899 https://api.github.com/repos/pydata/xarray/issues/1962 371355899 MDEyOklzc3VlQ29tbWVudDM3MTM1NTg5OQ== 1217238 2018-03-08T02:20:21Z 2018-03-08T02:20:21Z MEMBER

One potential edge case is if someone directly calls a ufunc reduce method, e.g., np.add.reduce. Previously, this would cast the xarray object to a numpy array, but now it will raise an error.

Example: ```

current xarray

In [3]: np.add.reduce(xr.DataArray([1])) Out[3]: 1

with this pull request

In [3]: np.add.reduce(xr.DataArray(0)) NotImplementedError: reduce method for ufunc <ufunc 'add'> is not implemented on xarray objects, which currently only support the call method. ```

Note that the more commonly used aliases for these reduce methods, e.g., np.sum() will continue to work since they check for sum() method on their argument.

There are also a few other ufunc methods that get used occasionally.

I think I'm OK breaking these because usage is so rare (and the work-around of casting to numpy arrays is so easy) but this should probably be noted in the release notes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  302153432
Powered by Datasette · Queries took 0.631ms · About: xarray-datasette