home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 260777664

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/1017#issuecomment-260777664 https://api.github.com/repos/pydata/xarray/issues/1017 260777664 MDEyOklzc3VlQ29tbWVudDI2MDc3NzY2NA== 6213168 2016-11-15T21:39:49Z 2016-11-15T21:39:49Z MEMBER

I've gone through it and it works great. A couple of very minor grievances:

1 Could you change repr to highlight the dims without coords? It's very easy not to notice them as they exclusively appear in the list on top!

e.g. change this

<xarray.DataArray (x: 5, y: 3, z: 7)> dask.array<xarray-..., shape=(5, 3, 7), dtype=float64, chunksize=(5, 3, 7)> Coordinates: * y (y) |S1 'a' 'b' 'c' * x (x) int64 1 2 3 4 5

to:

<xarray.DataArray (x: 5, y: 3, z: 7)> dask.array<xarray-..., shape=(5, 3, 7), dtype=float64, chunksize=(5, 3, 7)> Coordinates: * y (y) |S1 'a' 'b' 'c' * x (x) int64 1 2 3 4 5 * z (z) -

2 Could you change DataArray.drop() and all other similar functions to silently do nothing when you try to drop something that is in the dims but not in the coords? This caused breakages in my code BTW, as it was assuming that a dim always had a matching coord. Specifically, the code that broke was:

v2 = v1.sel(somedim=somevalue).drop('somedim')

I had to change it to:

v2 = v1.sel(somedim=somevalue) if 'somedim' in v2.coords: v2 = v2.drop('somedim')

which is annoyingly ugly. Silently skipping the missing coord is nicer, and makes a lot of sense. (you will still crash if there's no such dim though).

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