home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 292847045

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/issues/1366#issuecomment-292847045 https://api.github.com/repos/pydata/xarray/issues/1366 292847045 MDEyOklzc3VlQ29tbWVudDI5Mjg0NzA0NQ== 1217238 2017-04-10T04:27:02Z 2017-04-10T04:27:02Z MEMBER

This is a little tricky: there's only a single array Variable object (the MultiIndex), so we can't save attrs on any of the levels. But xarray doesn't raise an error in this case, because it's assigning to the temporary mda['band'] object, which immediately gets thrown away. There would be the same issue if you tried to assign an attribute to ds['time.dayofyear'].

I don't think Python syntax gives us any good options for identifying these cases. It's essentially the same problem as assigning to an indexing result, e.g., ds.sel(...).attrs = ..., though it's less obvious here since you're doing indexing, not a method call.

At the very least we could document that this doesn't work.

CC @benbovy in case he has any other ideas.

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