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/921#issuecomment-457745979,https://api.github.com/repos/pydata/xarray/issues/921,457745979,MDEyOklzc3VlQ29tbWVudDQ1Nzc0NTk3OQ==,1217238,2019-01-25T22:01:46Z,2019-01-25T22:01:46Z,MEMBER,We have `.sizes` now.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-457744454,https://api.github.com/repos/pydata/xarray/issues/921,457744454,MDEyOklzc3VlQ29tbWVudDQ1Nzc0NDQ1NA==,26384082,2019-01-25T21:57:08Z,2019-01-25T21:57:08Z,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; 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}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-255497739,https://api.github.com/repos/pydata/xarray/issues/921,255497739,MDEyOklzc3VlQ29tbWVudDI1NTQ5NzczOQ==,1217238,2016-10-22T01:08:52Z,2016-10-22T01:08:52Z,MEMBER,"With optional indexes (#1017) meaning that `ds.coords[...].size` may not always succeed (OK, depending on some implementation choices), the need for a consistent way to look up dimension sizes becomes even more severe. Rather than resolving the type inconsistency of `dims`, we could simply add a new attribute `sizes` to both `Dataset` and `DataArray` that is exactly equivalent to `Dataset.dims`. The `Dataset` API ends up a little bit redundant, but we have a consistent way to access this information. ","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-237250366,https://api.github.com/repos/pydata/xarray/issues/921,237250366,MDEyOklzc3VlQ29tbWVudDIzNzI1MDM2Ng==,2443309,2016-08-03T14:20:02Z,2016-08-03T14:20:02Z,MEMBER,"It seems to me that `xarray` has the same convention for `dims` that `netCDF4` has for `dimensions`, `OrderedDict` for the dataset, `tuple` for the variables (`DataArray`s). I do see the utility in switching to an `OrderedDict` for both. I have had times where I need to know the size of a dimension on a data array and as @shoyer mentioned, its a bit of a hunt at the moment. That would be my vote if we're willing to make that breaking change. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-237163191,https://api.github.com/repos/pydata/xarray/issues/921,237163191,MDEyOklzc3VlQ29tbWVudDIzNzE2MzE5MQ==,1217238,2016-08-03T07:26:29Z,2016-08-03T07:26:29Z,MEMBER,"One thing I like about `dims` being a frozen dictionary is that is makes the fixed, immutable nature of dimension sizes on the Dataset very obvious in the data model. If you had to use `ds.coords[...].size` to look up dimension sizes, this would be much less obvious. CC @jhamman in case he has thoughts here. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-236271882,https://api.github.com/repos/pydata/xarray/issues/921,236271882,MDEyOklzc3VlQ29tbWVudDIzNjI3MTg4Mg==,5635139,2016-07-29T19:26:50Z,2016-07-29T19:26:50Z,MEMBER,"Thanks for the, as ever, thoughtful response Should we move `Dataset.dims` to be a tuple, then? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-236235255,https://api.github.com/repos/pydata/xarray/issues/921,236235255,MDEyOklzc3VlQ29tbWVudDIzNjIzNTI1NQ==,1217238,2016-07-29T17:00:24Z,2016-07-29T17:00:24Z,MEMBER,"> I frequently need to pull out the dimension names, and I've never needed to pull out their sizes. Indeed, this is why this discrepancy has survived for so long. Both `'foo' in x` and iterations over `x` work the same for dictionary keys and tuples (thanks to duck typing). > Zooming out a bit: the access pattern for most of these (variables, coords) is indeed an OrderedDict of name to object. But the stickler for dim is why the size should be the value here? It seems very different from having dim objects as values. Agreed, it is a little weird, and probably unnecessary. It is arguably a left-over from the _very_ early days of xarray (before we had a DataArray type!). It occurs to me that it's not hard to pull sizes out of `ds.coords['time'].size` if necessary, and that's probably totally sufficient for getting dimension sizes for both DataArray and Dataset. We don't really need `dims_shape`. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-236224041,https://api.github.com/repos/pydata/xarray/issues/921,236224041,MDEyOklzc3VlQ29tbWVudDIzNjIyNDA0MQ==,5635139,2016-07-29T16:15:03Z,2016-07-29T16:15:03Z,MEMBER,"I frequently need to pull out the dimension names, and I've never needed to pull out their sizes. I realize that the internals need to do that though. And maybe my use case is specific. Zooming out a bit: the access pattern for most of these (variables, coords) is indeed an `OrderedDict` of name to object. But the stickler for dim is why the size should be the value here? It seems very different from having dim objects as values. I could certainly understand a convenience `dims_shape` (for `{dim: ds[dim].shape for dim in ds.dims}`. But I""m coming from a place of less context without that much confidence... ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-236097486,https://api.github.com/repos/pydata/xarray/issues/921,236097486,MDEyOklzc3VlQ29tbWVudDIzNjA5NzQ4Ng==,1217238,2016-07-29T05:26:22Z,2016-07-29T05:26:22Z,MEMBER,"> What are the arguments against having dims be a tuple for both DataArray & Datasets? I guess that's a third option! In that case, we'd have to add `shape` to Dataset, too, to ensure there is some way to get size information. The main downside is that we'd still be stuck without any idea way to get dimension sizes by name -- `ds.shape[ds.get_axis_num('time')]` is pretty bad. Also, I'm not sure how many use cases there are for actually pulling out the first dimension of a dataset (or it's shape) by position, given that dimension order is currently sorted independently of dimension order on any of its data arrays. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768 https://github.com/pydata/xarray/issues/921#issuecomment-236093456,https://api.github.com/repos/pydata/xarray/issues/921,236093456,MDEyOklzc3VlQ29tbWVudDIzNjA5MzQ1Ng==,5635139,2016-07-29T04:45:32Z,2016-07-29T04:45:32Z,MEMBER,"What are the arguments against having `dims` be a tuple for both `DataArray` & `Dataset`s? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,168243768