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/6142#issuecomment-1007746043,https://api.github.com/repos/pydata/xarray/issues/6142,1007746043,IC_kwDOAMm_X848EPv7,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
ds = xr.Dataset({""x"": ([(""a"", ""b"")], [1])})
print(ds)
print(f""{ds.x.dims = }"")
```
```python
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 `dim: Hashable`: #4821","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1094725752
https://github.com/pydata/xarray/issues/6142#issuecomment-1007250588,https://api.github.com/repos/pydata/xarray/issues/6142,1007250588,IC_kwDOAMm_X848CWyc,10194086,2022-01-07T09:13:21Z,2022-01-07T09:13:21Z,MEMBER,"> This will still work as two dims, since having `str | Iterable[Hashable]` rather than `Hashable | Iterable[Hashable]` means it will fail the first check. So if someone really wants a single dim as `(""x"", ""y"")`, they can pass `((""x"", ""y""),)`.
Yes, I think that is the gist of the proposal. I also think that it is quite elegant.
> Does this mean that this would be confusion free?
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 `xr.DataArray([1], dims=[(""x"", ""y"")]` works as proposed here.","{""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1094725752