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/401#issuecomment-221960807,https://api.github.com/repos/pydata/xarray/issues/401,221960807,MDEyOklzc3VlQ29tbWVudDIyMTk2MDgwNw==,1634164,2016-05-26T18:51:06Z,2016-05-26T18:51:06Z,NONE,"@jhamman thanks for taking this up and finishing it! ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-219189254,https://api.github.com/repos/pydata/xarray/issues/401,219189254,MDEyOklzc3VlQ29tbWVudDIxOTE4OTI1NA==,1217238,2016-05-14T00:34:14Z,2016-05-14T00:34:14Z,MEMBER,"Yes, I still think that makes sense. I don't like issuing warnings other than for deprecation cycles. On Fri, May 13, 2016 at 5:29 PM Joe Hamman notifications@github.com wrote: > @shoyer https://github.com/shoyer - reading back in this thread (#401 > (comment) > https://github.com/pydata/xarray/pull/401#issuecomment-96085330) you > mentioned moving this fix to conventions.py and writing a dtype: bool > attribute for bool typed variables. Do you still think that makes since? > > Alternatively, we could just raise a warning when typecasting on write. > This is the lazy but less intrusive way of operating. > > — > You are receiving this because you were mentioned. > > Reply to this email directly or view it on GitHub > https://github.com/pydata/xarray/pull/401#issuecomment-219188897 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-219188897,https://api.github.com/repos/pydata/xarray/issues/401,219188897,MDEyOklzc3VlQ29tbWVudDIxOTE4ODg5Nw==,2443309,2016-05-14T00:29:25Z,2016-05-14T00:29:25Z,MEMBER,"@shoyer - reading back in this thread (https://github.com/pydata/xarray/pull/401#issuecomment-96085330) you mentioned moving this fix to `conventions.py` and writing a `dtype: bool` attribute for `bool` typed variables. Do you still think that makes since? Alternatively, we could just raise a warning when typecasting on write. This is the lazy but less intrusive way of operating. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-219183250,https://api.github.com/repos/pydata/xarray/issues/401,219183250,MDEyOklzc3VlQ29tbWVudDIxOTE4MzI1MA==,1217238,2016-05-13T23:31:43Z,2016-05-13T23:31:43Z,MEMBER,"Karl -- if you or anyone else wants to pick up and finish this PR, that would be awesome. It is very close to being done. On Fri, May 13, 2016 at 4:30 PM, Karl Lapo notifications@github.com wrote: > I also ran into this problem -- I wanted to save a netcdf with a boolean > array. Casting the booleans as ints worked for my application. > > — > You are receiving this because you commented. > Reply to this email directly or view it on GitHub > https://github.com/pydata/xarray/pull/401#issuecomment-219183082 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-219183082,https://api.github.com/repos/pydata/xarray/issues/401,219183082,MDEyOklzc3VlQ29tbWVudDIxOTE4MzA4Mg==,6980561,2016-05-13T23:30:10Z,2016-05-13T23:30:10Z,NONE,"I also ran into this problem -- I wanted to save a netcdf with a boolean array. Casting the booleans as ints worked for my application. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-147809605,https://api.github.com/repos/pydata/xarray/issues/401,147809605,MDEyOklzc3VlQ29tbWVudDE0NzgwOTYwNQ==,2443309,2015-10-13T18:45:57Z,2015-10-13T18:45:57Z,MEMBER,"@khaeru - do you think you're going to come back to this? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-96086024,https://api.github.com/repos/pydata/xarray/issues/401,96086024,MDEyOklzc3VlQ29tbWVudDk2MDg2MDI0,1634164,2015-04-24T22:40:17Z,2015-04-24T22:40:17Z,NONE,"Thanks—putting this up was evidently the fastest ways to get pointers to those examples in the code! I'll add those items and comment again once I have. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-96085330,https://api.github.com/repos/pydata/xarray/issues/401,96085330,MDEyOklzc3VlQ29tbWVudDk2MDg1MzMw,1217238,2015-04-24T22:34:15Z,2015-04-24T22:34:15Z,MEMBER,"This seems like a pragmatic choice -- but I agree, it's unfortunate that we can't roundtrip this faithfully. One option would be to add the attribute `dtype` with the value `'bool'` to the netCDF variable, and then teach xray to interpret that attribute when loading data. We already do some pretty similar things to handle datetime64 variables according to the CF conventions. If you're interested in doing this, the right place to put this would be `conventions.py`: https://github.com/xray/xray/blob/eed58d5cb4274f262e77277bc8fcf394a9fae77c/xray/conventions.py#L632 (for decode, put decoding dtypes after decoding times at the bottom) https://github.com/xray/xray/blob/eed58d5cb4274f262e77277bc8fcf394a9fae77c/xray/conventions.py#L603 (for encoding, write another little helper function and call it at the bottom here) The other advantage of putting this in conventions is that then it works with all netCDF backends (including scipy and h5netcdf). Also, this definitely needs tests :). This could be as simple as verifying that it works to roundtrip a Dataset with boolean data to disk and back. Here's an example of what those look like: https://github.com/xray/xray/blob/eed58d5cb4274f262e77277bc8fcf394a9fae77c/xray/test/test_backends.py#L156 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273 https://github.com/pydata/xarray/pull/401#issuecomment-96082283,https://api.github.com/repos/pydata/xarray/issues/401,96082283,MDEyOklzc3VlQ29tbWVudDk2MDgyMjgz,2443309,2015-04-24T22:24:39Z,2015-04-24T22:24:39Z,MEMBER,"How does this handle the round trip conversion from `Dataset` to `netCDF` and back to `Dataset`. Do you now get an array of `u1`? Also, it may be good to add a unit test addressing your previous `ValueError`. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,70805273