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/1626#issuecomment-1112231763,https://api.github.com/repos/pydata/xarray/issues/1626,1112231763,IC_kwDOAMm_X85CS09T,601177,2022-04-28T13:51:17Z,2022-04-28T13:51:17Z,NONE,"> If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically
Still relevant.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,264582338
https://github.com/pydata/xarray/issues/1626#issuecomment-1111579003,https://api.github.com/repos/pydata/xarray/issues/1626,1111579003,IC_kwDOAMm_X85CQVl7,26384082,2022-04-27T23:37:45Z,2022-04-27T23:37:45Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity
If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,264582338
https://github.com/pydata/xarray/issues/1626#issuecomment-687267764,https://api.github.com/repos/pydata/xarray/issues/1626,687267764,MDEyOklzc3VlQ29tbWVudDY4NzI2Nzc2NA==,2418513,2020-09-04T16:55:48Z,2020-09-04T16:55:48Z,NONE,"This is an ancient issue, but still - wondering if anyone here managed to hack together some workarounds?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,264582338
https://github.com/pydata/xarray/issues/1626#issuecomment-427195935,https://api.github.com/repos/pydata/xarray/issues/1626,427195935,MDEyOklzc3VlQ29tbWVudDQyNzE5NTkzNQ==,23484003,2018-10-04T22:59:19Z,2018-10-08T15:10:54Z,NONE,"I just got bit with this as well. I was basically using tuples of indices as coordinates in order to implement a [multidimensional sparse array](https://github.com/pydata/xarray/issues/1375) .
My workaround is to use plain dimension `index_dim` to index the points in the N-dimensional space that I actually populate, and to have several coordinates (say `X,Y`) that all have `index_dim` as their only dimension. It's easy enough to see what the coordinates are once you select a value along `index_dim`, but I have to go outside `xarray` to locate a populated point based on it's `X,Y`-coordinates, because I can't slice along those arrays as (A) they aren't aliased to a dimension (B) they have non-unique values.
I've come up with an ugly method for selecting by `tuples` of `X,Y`-coordinates:
pairs = zip(x_wanted,y_wanted)
pair2index = {(dataset.x[i].item(), dataset.y[i].item()):i for i in dataset.index_dim.data}
try:
found_indices = [pair2index[p] for p in pairs]
found = dataset.isel(index_dim=found_indices)
except KeyError:
print ""Coordinate {} not found in dataset."".format(p)
raise
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,264582338
https://github.com/pydata/xarray/issues/1626#issuecomment-363129063,https://api.github.com/repos/pydata/xarray/issues/1626,363129063,MDEyOklzc3VlQ29tbWVudDM2MzEyOTA2Mw==,601177,2018-02-05T15:59:50Z,2018-02-05T22:01:35Z,NONE,"I'd also like to see better support for compound types, writing them for starters. I'll collect some information here:
* In the code @tfurf linked to ([_nc4_values_and_dtype](https://github.com/pydata/xarray/blob/27132fba1e465955e76ed155ba6cbb769c0904df/xarray/backends/netCDF4_.py#L81)), an `elif` needs to be added to catch structured dtypes. I think they have `kind == 'V'`.
* [`dtype.builtin`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.isbuiltin.html) can be used to detect whether we are indeed dealing with a structured type. Namely `dtype.builtin` must be `0`.
* The structured type must fist be added to the `netCDF4.Dataset` using its method [`createCompoundType`](https://unidata.github.io/netcdf4-python/#netCDF4.Dataset.createCompoundType). This must be done recursively, with the deepest levels first.
* The netCDF variable is created in [`prepare_variable`](https://github.com/pydata/xarray/blob/27132fba1e465955e76ed155ba6cbb769c0904df/xarray/backends/netCDF4_.py#L311), which calls `_nc4_values_and_dtype`. There, via `self.ds` we also have access to the netCDF4 `Dataset` to be used for the creation of the as mentioned above. [However, is `self.ds` really the Dataset, or some `NetCDF4.Group`?](https://github.com/pydata/xarray/blob/27132fba1e465955e76ed155ba6cbb769c0904df/xarray/backends/netCDF4_.py#L112) In any case `_nc4_values_and_dtype` and its use in `prepare_variable` needs to be refactored, because we need access to the underlying netCDF4 `Dataset`.
Is there anything I've missed? Can someone shed light on whether `self.ds` in `prepare_variable` can be assumed to the underlying netCDF4 `Dataset`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,264582338