home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 873492892

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/4118#issuecomment-873492892 https://api.github.com/repos/pydata/xarray/issues/4118 873492892 MDEyOklzc3VlQ29tbWVudDg3MzQ5Mjg5Mg== 35968931 2021-07-04T00:51:19Z 2021-07-04T00:51:19Z MEMBER

Some other thoughts about tags:

1) Does the definition of tags include variable names of DataArrays? I think it should.

2) As @martinitus mentioned, a DataTree containing only leaves with only 1 tag each is effectively a Dataset. I wonder if Dataset could be refactored to be a special case of a more general DataTree, possibly as a subclass?

3) Selecting via tags would need to allow a distinction between "get me all leaves with these exact tags" and "get me all leaves whose tags include these ones". Maybe dt.choose_only(tags) and dt.choose_all(tags)?

4) The latter type of tag-based access would make plotting different leaves against one another easier too - given a multi-resolution (or multi-model) datatree like this:

dt |-- high_res | |-- temperature | |-- CO2 |-- medium_res | |-- temperature | |-- CO2 |-- low_res | |-- temperature | |-- CO2

then assuming that the definition of tags included the DataArray variable names, then

dt.choose_all('temperature').plot.line(x='time')

would select all leaves with a tempature tag, check that the temperature DataArrays had the same dimensions (but no need for any time coordinates to share size or values), and then plot them against one another on the same axes. This would be so useful - I would say this use case is 90% of the reason users iterate over dictionaries of datasets currently.

5) With a tag-based system you can create cycles of tags, like A&B, B&C, C&A, which you can't really do with hierarchical trees. I don't think that actually causes any problems though...

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