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/2636#issuecomment-450457809,https://api.github.com/repos/pydata/xarray/issues/2636,450457809,MDEyOklzc3VlQ29tbWVudDQ1MDQ1NzgwOQ==,2448579,2018-12-29T02:28:53Z,2018-12-29T02:28:53Z,MEMBER,"The values of your `time` variable are preserved but the `units` change. I wonder if we should consider this a round-tripping bug. ``` python attrs = {'units': 'hours since 2015-01-01'} ds_1 = xr.Dataset({'temperature': (['x', 'y', 'time'], temp)}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': ('time', [100, 101, 102], attrs)}) print(ds_1.time.attrs) ds_1.to_netcdf('ds1.nc') file = xr.open_dataset('ds1.nc') print(file.time.attrs) file.close() ``` gives output ``` OrderedDict([('units', 'hours since 2015-01-01')]) OrderedDict() ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,394625579 https://github.com/pydata/xarray/issues/2636#issuecomment-450382495,https://api.github.com/repos/pydata/xarray/issues/2636,450382495,MDEyOklzc3VlQ29tbWVudDQ1MDM4MjQ5NQ==,2448579,2018-12-28T16:03:23Z,2018-12-28T16:03:23Z,MEMBER,"I have never tried this but try setting those units as encoding, not attrs. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,394625579