issue_comments: 1023511142
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/6196#issuecomment-1023511142 | https://api.github.com/repos/pydata/xarray/issues/6196 | 1023511142 | IC_kwDOAMm_X849AYpm | 35968931 | 2022-01-27T18:16:01Z | 2022-01-27T18:41:30Z | MEMBER | Thanks for raising this suggestion @lanougue .
What do you think it should return? When selecting a coordinate there seem to be only 3 options to me: 1) Coordinate variables retain all coordinates from the parent object. This is what it currently does. It's a bit counter-intuitive, but it prioritises keeping coordinates available for use by users. It also means you can pull out a coordinate variable and then use other coordinates to index into it. 2) Coordinate variables retain no coordinates at all. We could drop all of them, which makes some sense (why should a coordinate have coordinates?). We can try that out naively by adding a ```python def _getitem_coord(self, key): from .dataset import _get_virtual_variable
3) *Coordinate variables retain only coordinates with which they share some dimensions You might say "well in my example I agree this is a little counterintuitive, but it is actually causing you problems? Because I think there is a rationale for the current behaviour, and changing it would be a breaking change. In other words, it's not obvious to me that this is a bug rather than an implicit feature. (One might also argue that if Interested to hear what you think though. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1115166039 |