issue_comments
5 rows where issue = 1115166039 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- Wrong list of coordinate when a singleton coordinate exists · 5 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
1450762730 | https://github.com/pydata/xarray/issues/6196#issuecomment-1450762730 | https://api.github.com/repos/pydata/xarray/issues/6196 | IC_kwDOAMm_X85WeOHq | dcherian 2448579 | 2023-03-01T19:54:47Z | 2023-03-01T19:54:47Z | MEMBER | Yes when you index out a single location
Xarray only checks if a coordinate variable's dimensions are a subset of the extracted DataArray dimensions. for a scalar, |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Wrong list of coordinate when a singleton coordinate exists 1115166039 | |
1450036767 | https://github.com/pydata/xarray/issues/6196#issuecomment-1450036767 | https://api.github.com/repos/pydata/xarray/issues/6196 | IC_kwDOAMm_X85Wbc4f | lanougue 32069530 | 2023-03-01T12:09:21Z | 2023-03-01T12:09:40Z | NONE | Hello @TomNicholas , Reopening this issue 1 year later ! To answer your last question, singleton dimension seems to have, indeed, a unique behavior since they are reattached systematically to other coordinates (even if they naturally do not share any dimension with other coordinates).
These singleton dimensions introduce some strange behavior. This is another example:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Wrong list of coordinate when a singleton coordinate exists 1115166039 | |
1027064212 | https://github.com/pydata/xarray/issues/6196#issuecomment-1027064212 | https://api.github.com/repos/pydata/xarray/issues/6196 | IC_kwDOAMm_X849N8GU | TomNicholas 35968931 | 2022-02-01T16:59:51Z | 2022-02-01T16:59:51Z | MEMBER |
Can you perhaps use
I'm not quite sure I understand what you mean - currently aren't all coordinates reattached to any coordinate extracted from a DataArray? (so long as they have compatible dimensions) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Wrong list of coordinate when a singleton coordinate exists 1115166039 | |
1026774266 | https://github.com/pydata/xarray/issues/6196#issuecomment-1026774266 | https://api.github.com/repos/pydata/xarray/issues/6196 | IC_kwDOAMm_X849M1T6 | lanougue 32069530 | 2022-02-01T12:07:51Z | 2022-02-01T12:07:51Z | NONE | Thanks for the enlightening. Actually, this coordinates dependency with singleton dimension caused me a problem when using the to_netcdf() function. No problem playing whith the xr.Dataset but I get some error when trying to write on disk using to_netcdf(). For now, I wasn't able to reproduce a minimalist example because the error disappears with minimalist example. I wasn't able to find the fundamental difference between the dataset causing the error and the minimalist one. Printing them are exactly the same. I have to do deeper inspection. Concerning the philosophy of what a coordinate should be: For me the "label" idea is understandable at a dataset level. A singleton dimension become a (shared) "label' for the whole dataset. This is ok for me. However, I do not understand why it should also be a "label" of the other coordinates of the dataset. A singleton dimension should not be "more important" than the other (not singleton) dimensions. Why the singleton dimension should become a "label" of another dimension while the other dimensions are not. This do not seem logical to me. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Wrong list of coordinate when a singleton coordinate exists 1115166039 | |
1023511142 | https://github.com/pydata/xarray/issues/6196#issuecomment-1023511142 | https://api.github.com/repos/pydata/xarray/issues/6196 | IC_kwDOAMm_X849AYpm | TomNicholas 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 } |
Wrong list of coordinate when a singleton coordinate exists 1115166039 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [issue] INTEGER REFERENCES [issues]([id]) ); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);
user 3