issue_comments
14 rows where issue = 1094725752 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- dimensions: type as `str | Iterable[Hashable]`? · 14 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
1166509214 | https://github.com/pydata/xarray/issues/6142#issuecomment-1166509214 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85Fh4Se | headtr1ck 43316012 | 2022-06-26T11:57:39Z | 2022-06-26T11:57:39Z | COLLABORATOR | See https://github.com/python/typing/issues/256 as reference for this problem. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1138997020 | https://github.com/pydata/xarray/issues/6142#issuecomment-1138997020 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85D47cc | max-sixty 5635139 | 2022-05-26T20:27:19Z | 2022-05-26T20:27:19Z | MEMBER | Ah, that's a good case @headtr1ck . So I don't have an immediate solution in mind unfortunately. I'm not sure having different return types is a great design in general, though I can see the logic for it in this case... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1137623370 | https://github.com/pydata/xarray/issues/6142#issuecomment-1137623370 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85DzsFK | headtr1ck 43316012 | 2022-05-25T17:40:16Z | 2022-05-25T17:40:16Z | COLLABORATOR | I have encountered another problem that is related to this:
So I tried to overload this: ```python @overload def argmin( self, dim: Hashable, *, axis: int | None = None, keep_attrs: bool | None = None, skipna: bool | None = None, ) -> DataArray: ...
``` but mypy complains:
I suspect that this is due to the fact that None is actually Hashable and therefore a valid dimension. Unfortunately, using this proposal of |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1132147701 | https://github.com/pydata/xarray/issues/6142#issuecomment-1132147701 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85DezP1 | headtr1ck 43316012 | 2022-05-19T20:05:43Z | 2022-05-19T20:05:43Z | COLLABORATOR |
Wow, totally forgot about this. Then you are right, Any as key is totally ok. Although if I am not mistaken, one could define a custom Mapping class that allows non-hashable keys, this is quite a niche use case and there are more urgent things to type, like this issue. |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1132117191 | https://github.com/pydata/xarray/issues/6142#issuecomment-1132117191 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85DerzH | max-sixty 5635139 | 2022-05-19T19:28:04Z | 2022-05-19T19:28:04Z | MEMBER |
I spent a non-trivial amount of time on this a year ago or so — my understanding is that But I'm also not sure we lose anything with e.g. https://mypy-play.net/?mypy=latest&python=3.10&gist=a3ea9f6fce5a678803bd7563a54cd9ca
Very cool! I didn't even know about this. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1132105430 | https://github.com/pydata/xarray/issues/6142#issuecomment-1132105430 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85Deo7W | headtr1ck 43316012 | 2022-05-19T19:14:41Z | 2022-05-19T19:20:28Z | COLLABORATOR | Only remotely related to this issue, but would it help to type the dimension (or variable names etc) Mappings with covariant Hashable keys to prevent the issue that Something like:
Same for lists etc. (Or use Sequences which are already covariant, as opposed to lists) I am not an expert on variance in types and don't know if this would break things, but at least in my tests mypy did not complain when using See https://mypy-play.net/?mypy=latest&python=3.10&gist=b2c27a5ca4aad9e8ce63cd74dc4032b0 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1116791799 | https://github.com/pydata/xarray/issues/6142#issuecomment-1116791799 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85CkOP3 | max-sixty 5635139 | 2022-05-04T00:21:34Z | 2022-05-04T00:21:34Z | MEMBER |
I would have thought this is indeed the case. I think we're quite open to adjusting this so that it works, but it would probably needs some work, including defining common patterns — e.g. the title of this issue is a good approach
I also think we'd be up for reforming this! Generally this is the first arg and so only used positionally, but it still makes sense to have them consistent. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1116686433 | https://github.com/pydata/xarray/issues/6142#issuecomment-1116686433 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85Cj0hh | headtr1ck 43316012 | 2022-05-03T21:39:07Z | 2022-05-03T21:39:07Z | COLLABORATOR | I was just looking through the code a bit and I must say that the usage of dimension arguments is far from harmonized in the code....
Apart from arguments randomly being called
At least internally most objects use The lazy shortcut to allow a single str is making this more complicated than one might think (but I have to admit, I use it all the time). |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1116434282 | https://github.com/pydata/xarray/issues/6142#issuecomment-1116434282 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X85Ci29q | headtr1ck 43316012 | 2022-05-03T18:39:46Z | 2022-05-03T18:39:46Z | COLLABORATOR | In case you are missing a use case for tuples as dimension/variable names: We have a system with two detectors, lets call them "a" and "b". Both take 2D images with dimensions "x" and "y" but different sizes. Now instead of calling the dimensions "x_a", "y_a", "x_b", "y_b" we call them ("x", "a") etc. This makes looking for dimensions etc. more consistent (Even better with a custom hashable dimension class). |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1007746043 | https://github.com/pydata/xarray/issues/6142#issuecomment-1007746043 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X848EPv7 | mathause 10194086 | 2022-01-07T21:15:23Z | 2022-01-07T21:15:23Z | MEMBER | I agree this is confusing, what is meant here is to use a tuple as the name for one dimension. An example:
```python <xarray.Dataset> Dimensions: (('a', 'b'): 1) Dimensions without coordinates: ('a', 'b') Data variables: x (('a', 'b')) int64 1 ds.x.dims = (('a', 'b'),) ``` I found the issue again where we discussed that we want to keep |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1007729786 | https://github.com/pydata/xarray/issues/6142#issuecomment-1007729786 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X848ELx6 | TomNicholas 35968931 | 2022-01-07T20:46:40Z | 2022-01-07T20:46:40Z | MEMBER |
Sorry, I don't understand this - if I want to type hint |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1007250588 | https://github.com/pydata/xarray/issues/6142#issuecomment-1007250588 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X848CWyc | mathause 10194086 | 2022-01-07T09:13:21Z | 2022-01-07T09:13:21Z | MEMBER |
Yes, I think that is the gist of the proposal. I also think that it is quite elegant.
I think it would be relatively unambiguous but not necessarily entirely confusion free for the user ("Why is the type of a single dim more restricted than of several dimensions?"). Maybe this warrants an entry in our FAQ or somewhere? Also we need to go over our code and update our typing and make sure stuff like |
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1006622944 | https://github.com/pydata/xarray/issues/6142#issuecomment-1006622944 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X847_9jg | max-sixty 5635139 | 2022-01-06T14:13:58Z | 2022-01-06T14:13:58Z | MEMBER | Thanks for writing this out. I realize something clever about the proposal: Our very first line of code in the docs passes dims as a tuple This will still work as two dims, since having Does this mean that this would be confusion free? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 | |
1006104672 | https://github.com/pydata/xarray/issues/6142#issuecomment-1006104672 | https://api.github.com/repos/pydata/xarray/issues/6142 | IC_kwDOAMm_X8479_Bg | shoyer 1217238 | 2022-01-05T21:48:05Z | 2022-01-05T21:48:05Z | MEMBER |
Yes, this was my suggestion. |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
dimensions: type as `str | Iterable[Hashable]`? 1094725752 |
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 5