home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 176869693

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/731#issuecomment-176869693 https://api.github.com/repos/pydata/xarray/issues/731 176869693 MDEyOklzc3VlQ29tbWVudDE3Njg2OTY5Mw== 1217238 2016-01-29T17:20:50Z 2016-01-29T17:20:50Z MEMBER

In the dask test I'm having a little trouble with: self.assertLazyAndAllClose(eager, lazy) working with the DataArrays I make. Does it only take transformations of: self.eager_array self.lazy_array

Nope, it can handle any eager (numpy) and lazy (dask) xarray objects. Something like this should work:

```

depending on exactly what syntax we support

eager = self.eager_array.tensordot(self.eager_array[0]) lazy = self.lazy_array.tensordot(self.lazy_array[0])) self.assertLazyAndAllClose(eager, lazy) ```

The default (when no dims arg is given) should be to tensordot over all shared dims between DataArrays. And it should prevent you from not summing over all shared dims, since that will return a DataArray with repeated labels. I think it would be rare for people to want to tensor dot over different dimensions.

This is a good point! Arrays with redundant dimensions are not very useful.

The sane thing to do is to broadcast over dimensions that aren't being summed einsum style (e.g., like i in einsum('ij,ij->i', x, y)). This is similar to the way that @/np.matmul works.

That said, this is difficult to implement with numpy's dot/tensordot, so perhaps it's better to simply error or omit the dims argument entirely for now. Eventually, we might be able to do this using @/np.matmul (only in numpy 1.10 and newer).

I also wonder if perhaps we should rename this from tensordot to simply dot. I don't think we would want to use dot for anything else, and it might also be nice to support @ syntax as an alias for this in Python 3 (again, at some later point).

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