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/pull/2131#issuecomment-395647556,https://api.github.com/repos/pydata/xarray/issues/2131,395647556,MDEyOklzc3VlQ29tbWVudDM5NTY0NzU1Ng==,1217238,2018-06-08T05:00:59Z,2018-06-08T05:00:59Z,MEMBER,v0.10.7 is out,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,323017930
https://github.com/pydata/xarray/pull/2131#issuecomment-395534752,https://api.github.com/repos/pydata/xarray/issues/2131,395534752,MDEyOklzc3VlQ29tbWVudDM5NTUzNDc1Mg==,1217238,2018-06-07T19:18:55Z,2018-06-07T19:18:55Z,MEMBER,"@rsignell-usgs Sure, though `interp()` (https://github.com/pydata/xarray/pull/2104) is almost ready, too, so we might wait for that.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,323017930
https://github.com/pydata/xarray/pull/2131#issuecomment-389298331,https://api.github.com/repos/pydata/xarray/issues/2131,389298331,MDEyOklzc3VlQ29tbWVudDM4OTI5ODMzMQ==,1217238,2018-05-15T20:14:06Z,2018-05-15T20:14:06Z,MEMBER,"Thinking about this a little more, maybe we should consolidate pickling with autoclosing into a single, composable wrapper class. Usage would look something like:
```python
wrapper = FileWrapper(netCDF4.Dataset, path, mode='r', autoclose=False, kwargs=kwargs)
with wrapper:
# will close/open wrapped file
with wrapper.acquire() as ds:
# context manager is dummy, simply returning the open file object
... # do stuff with ds, a netCDF4.Dataset instance
# or could write wrapper.close() instead of using the context manager
wrapper = FileWrapper(netCDF4.Dataset, path, mode='r', autoclose=True, kwargs=kwargs)
with wrapper:
# explicit opening/closing the wrapper is a no-op if autoclose=True
with wrapper.acquire() as ds:
# context manager opens/closes file
# if file is already open, it's a no-op
... # do stuff with ds, a netCDF4.Dataset instance
```
We could then expose `xarray.backends.FileWrapper` as part of our external API for backend authors (without coupling it into the Datastore class directly).
Eventually, we might even change the default for `autoclose` to automatically use LRU caching (but that obviously would come later).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,323017930