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/992#issuecomment-258949295,https://api.github.com/repos/pydata/xarray/issues/992,258949295,MDEyOklzc3VlQ29tbWVudDI1ODk0OTI5NQ==,3404817,2016-11-07T20:14:37Z,2016-11-07T20:14:37Z,CONTRIBUTOR,"Great to see you are pushing forward on this issue @jhamman and @shoyer. I would really have liked to contribute here, but it seems like there are quite some design choices to make, which are better left in your hands.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173773358
https://github.com/pydata/xarray/issues/992#issuecomment-243367823,https://api.github.com/repos/pydata/xarray/issues/992,243367823,MDEyOklzc3VlQ29tbWVudDI0MzM2NzgyMw==,3404817,2016-08-30T08:22:32Z,2016-08-30T08:22:32Z,CONTRIBUTOR,"@jhamman sorry, I only now saw that you pointed to a previous issue on the same topic (with exactly the same considerations). I did not find that issue when I searched (for ""unlimited"").
You were against changing `to_netcdf` [then](https://github.com/pydata/xarray/issues/678#issuecomment-164082151). Are you still?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173773358
https://github.com/pydata/xarray/issues/992#issuecomment-243365966,https://api.github.com/repos/pydata/xarray/issues/992,243365966,MDEyOklzc3VlQ29tbWVudDI0MzM2NTk2Ng==,3404817,2016-08-30T08:14:08Z,2016-08-30T08:14:08Z,CONTRIBUTOR,"The above solution would not require much more than that,
in [`set_necessary_dimensions`](https://github.com/pydata/xarray/blob/master/xarray/backends/common.py#L222-L225),
```
def set_necessary_dimensions(self, variable):
for d, l in zip(variable.dims, variable.shape):
if d not in self.dimensions:
self.set_dimension(d, l)
```
would become
```
def set_necessary_dimensions(self, variable):
for d, l in zip(variable.dims, variable.shape):
if d in self._unlimited_dimensions:
l = None
if d not in self.dimensions:
self.set_dimension(d, l)
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173773358
https://github.com/pydata/xarray/issues/992#issuecomment-243364284,https://api.github.com/repos/pydata/xarray/issues/992,243364284,MDEyOklzc3VlQ29tbWVudDI0MzM2NDI4NA==,3404817,2016-08-30T08:06:49Z,2016-08-30T08:07:07Z,CONTRIBUTOR,"But maybe the `encoding` dict is not the way to go after all, since it contains entries per **variable**, while it is the **dimension** that must be unlimited.
Currently the dataset variables can be created in any order and their necessary dimensions created whenever needed (in the [`set_necessary_dimensions`](https://github.com/pydata/xarray/blob/master/xarray/backends/common.py#L222-L225) function). I would **not** like to change that logic (e.g. towards creating all dimensions required by all variables first, before adding the data variables).
So how about a new kw argument to `to_netcdf`, like
```
ds.to_netcdf(unlimited_dimensions=['time'])
```
or
```
ds.to_netcdf(dimension_unlimited={'time': True})
```
(the second option better for explicitly setting {'time': False})?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173773358
https://github.com/pydata/xarray/issues/992#issuecomment-243350429,https://api.github.com/repos/pydata/xarray/issues/992,243350429,MDEyOklzc3VlQ29tbWVudDI0MzM1MDQyOQ==,3404817,2016-08-30T06:59:14Z,2016-08-30T06:59:14Z,CONTRIBUTOR,"I think it makes sense to preserve the `UNLIMITED` state through read/write. In my case, I subset a netCDF file along `lat` and `lon` dimensions, leaving the `time` dimension untouched and would therefore expect it to pass unchanged through `xarray` IO (staying `UNLIMITED`).
However, when the dataset is indexed/subset/resampled along the unlimited dimension, it would make sense that its state is dropped. But that would require a lot of ifs and buts, so I suggest we leave that aside for now.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173773358
https://github.com/pydata/xarray/issues/992#issuecomment-243253510,https://api.github.com/repos/pydata/xarray/issues/992,243253510,MDEyOklzc3VlQ29tbWVudDI0MzI1MzUxMA==,3404817,2016-08-29T20:56:55Z,2016-08-29T20:56:55Z,CONTRIBUTOR,"OK, I'd be up for taking a shot at it.
Since it is per-variable and specific to netCDF, I guess the perfect place to add this is in the `encoding` dictionary that you can pass to [`to_netcdf`](https://github.com/pydata/xarray/blob/606e1d9c7efd72e10b530a688d6ef870e8ec1843/xarray/backends/api.py#L316), right? Maybe as key `unlimited`? E.g.
```
ds.to_netcdf(encoding={'time': dict(unlimited=True)})
```
I need to look up whether netCDF allows for defining more than one unlimited dimension, otherwise that must throw an error.
And then it is just about passing `None` as length to `CreateDimension`, at least in `netCDF4` and `scipy.io.netcdf`. But I did not look into how xarray handles that under the hood.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,173773358