home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 321213528

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/1473#issuecomment-321213528 https://api.github.com/repos/pydata/xarray/issues/1473 321213528 MDEyOklzc3VlQ29tbWVudDMyMTIxMzUyOA== 6815844 2017-08-09T10:10:58Z 2017-08-09T11:10:14Z MEMBER

@shoyer

Overwrite da['x'] by ind['x'] seems bad.

Agreed. I changed the code not to overwrite coordinate.

My inclination would be that it's OK to add coordinates from the indices as long as they aren't conflicting.

My current implementation does this, but I am still worrying about even in this situation there will be a similar unexpected behavior, e.g. because an unexpected coordinate is attached in previous indexing, the coordinate to be attached would be silently neglected.

I think we may need a careful API decision. I am currently thinking (assuming indexers = {k: ind}) + If ind.dims == (k, ) (indexing-DataArray has the same dimension to the dimension to be indexed along), we neglect ind.coords[k]. + If ind.dims != (k, ) and ind.dims not in da.dims, then we attach a new coordinate ind.coords[ind.dims] + If ind.dims != (k, ) and ind.dims in da.dims, then raise an Error.

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