home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 851631521

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/2533#issuecomment-851631521 https://api.github.com/repos/pydata/xarray/issues/2533 851631521 MDEyOklzc3VlQ29tbWVudDg1MTYzMTUyMQ== 5635139 2021-05-31T18:38:43Z 2021-05-31T18:38:43Z MEMBER

Hmmmm. It's been quite some time since I've last used xarray, but I'm not sure I see an easy way to:

1. hijack np.insert (which I would guess goes directly to `DataArray.__array_wrap__ / __array_finalize__`)

2. without passing a `fastpath`-like argument to `__array_wrap__`, but

3. efficiently not checking the shape of safe operations, like `_unary_op`.

I think that's exactly correct. Without being able to tell __array_wrap__ from _unary_op that we don't need to check the sizes, they all follow the same path. Is it possible to use the context arg for this? I don't think it's sufficiently flexible from an initial glance of the docs.

Maybe this new implementation has a low enough overhead that it's worthwhile?

If we do go ahead — what about calling _check_shape_consistency from within __array_wrap__ after creating the object, instead of adding the fastpath kwarg?

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