home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 290250866

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/1092#issuecomment-290250866 https://api.github.com/repos/pydata/xarray/issues/1092 290250866 MDEyOklzc3VlQ29tbWVudDI5MDI1MDg2Ng== 1217238 2017-03-29T22:54:17Z 2017-03-29T22:54:17Z MEMBER

I'm also having thoughts about the attribute access: if ds['flux']['poloidal'] = subset does not work, then neither does ds.flux.poloidal = subset, correct? If so, it is almost pointless to have the attribute access in the first place.

Yes, this is correct. But note that ds.flux = array is not also supported -- only attribute access in xarray only works for getting, not setting. If you try it, you get an error message, e.g., AttributeError: cannot set attribute 'bar' on a 'DataArray' object. Use __setitem__ style assignment (e.g., `ds['name'] = ...`) instead to assign variables.

A big difference between xarray and netCDF4-python datasets is that the children datasets in xarray can go have a life of their own, independent of their parent & the file it represents.

Yes, this is true. We would possibly want to make another Dataset subclass for the sub-datasets to ensure that their variables are linked to the parent, e.g., xarray.LinkedDataset. This would enable ds['flux']['poloidal'] = subset.

But I'm also not convinced this is actually worth the trouble given how easy it is to write ds['flux', 'poloidal'].

NumPy has similar issues, e.g., x[i, j] = y works but x[i][j] = y does not.

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