home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 791033734

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/4979#issuecomment-791033734 https://api.github.com/repos/pydata/xarray/issues/4979 791033734 MDEyOklzc3VlQ29tbWVudDc5MTAzMzczNA== 2448579 2021-03-04T23:43:47Z 2021-03-04T23:43:47Z MEMBER

I think that for now it would be reasonable to restrict those methods to the indexes that are currently available in Xarray instead of trying to extend the API of Xarray index wrappers in order to support those special cases.

Fully agree. We should raise nice error messages when possible. I just wanted to raise awareness about this issue (i.e. methods that use indexes in non-trivial ways).

Are the CRSIndex and XgcmIndex examples really independent of any coordinate in the DataArray/Dataset?

Good point! I hadn't thought of it that way.

A major advantage is that using a custom index, there's no need to encapsulate a Dataset/DataArray into a higher level structure (e.g., xgcm.Grid) and there would be more control on how it is propagated from one xarray object to another compared to an attribute or via a "stateful" accessor (e.g., crs)

Yes! I'm v. happy to see this discussion is happening :)

But that can be also a downside: unless we allow multiple indexes per coordinate, such XgcmGridIndex and CRSIndex would then have the responsibility of handling selection and alignment for all their corresponding coordinates. That may not be a big deal, though: XgcmGridIndex and CRSIndex could simply encapsulate pandas.Index instances for all (or a subset) of their coordinates.

For XgcmIndex this is even desirable: https://github.com/xgcm/xgcm/issues/200, Re CRSIndex I think you're correct, it could just forward to whatever Index class it's wrapping

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