id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 128528319,MDU6SXNzdWUxMjg1MjgzMTk=,722,All dimmensions become coordinates?,242610,closed,0,,,4,2016-01-25T12:39:57Z,2016-12-29T01:12:16Z,2016-12-29T01:12:16Z,NONE,,,,"I have a netcdf file that looks like this (ncdump): ``` netcdf filevYpcG2 { dimensions: coor1 = 2 ; dim1 = 2 ; variables: int coor1(coor1) ; coor1:_FillValue = 999999 ; int var1(coor1) ; var1:_FillValue = 999999 ; int var2(dim1) ; var2:units = ""unit1"" ; var2:_FillValue = 999999 ; var2:attr_name = ""variable1"" ; // global attributes: :metadata1 = ""metadata1"" ; data: coor1 = 1, 2 ; var1 = 1, 2 ; var2 = 3, 4 ; } ``` When opening it in xray (xarray) I therefore expect `dim1` to be a dimension and `coor1` to be a coordinate, because `coor1` is also a variable, `coor1(coor1)`? But when opening the dataset in xray, I get the following: ``` In [1]: import xray; In [2]: filename = ""/tmp/filevYpcG2"" In [3]: x = xray.open_dataset(filename) In [4]: x Out[4]: Dimensions: (coor1: 2, dim1: 2) Coordinates: * coor1 (coor1) float64 1.0 2.0 * dim1 (dim1) int64 0 1 Data variables: var1 (coor1) float64 1.0 2.0 var2 (dim1) float64 3.0 4.0 Attributes: metadata1: metadata1 In [5]: x.coords Out[5]: Coordinates: * coor1 (coor1) float64 1.0 2.0 * dim1 (dim1) int64 0 1 In [6]: x.dims Out[6]: Frozen(SortedKeysDict({u'coor1': 2, u'dim1': 2})) In [7]: x.data_vars Out[7]: Data variables: var1 (coor1) float64 1.0 2.0 var2 (dim1) float64 3.0 4.0 ``` That is, both `coor1` and `dim1` becomes coordinate variables. I expected only `coor1` to become a coordinate variable, and not `dim1`. Am I wrohg, or is it meant to be like this? ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/722/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 129843955,MDU6SXNzdWUxMjk4NDM5NTU=,734,Coords that look like ranges are not written in netcdf files.,242610,closed,0,,,1,2016-01-29T18:21:02Z,2016-01-30T01:04:26Z,2016-01-30T01:04:26Z,NONE,,,,"This may be related to #733, but I am not sure, so I create a new one to keep it clean. It was discovered when creating the second example for #722 . When the `coords` from #722 are changed to `coords=[np.array([0, 1], np.int64)]`, they are not written to the netcdf file. Example: ``` In [1]: import xray as xr In [2]: import numpy as np In [3]: var1 = xr.DataArray(np.array([1, 2], np.float64), coords=[np.array([0, 1], np.int64)], dims=[""coor1"",], name = ""var1"") In [4]: var2 = xr.DataArray(np.array([3, 4], np.float64), dims=[""dim1"",], name = ""var2"") In [5]: ds = xr.Dataset({""var1"": var1, ""var2"": var2}) In [6]: ds Out[6]: Dimensions: (coor1: 2, dim1: 2) Coordinates: * coor1 (coor1) int64 0 1 * dim1 (dim1) int64 0 1 Data variables: var1 (coor1) float64 1.0 2.0 var2 (dim1) float64 3.0 4.0 In [7]: ds.to_netcdf(""/tmp/from_xr_2.nc"") ``` And then, no `coor1` data variable in the file: ``` $ ncdump /tmp/from_xr_2.nc netcdf from_xr_2 { dimensions: coor1 = 2 ; dim1 = 2 ; variables: double var1(coor1) ; double var2(dim1) ; data: var1 = 1, 2 ; var2 = 3, 4 ; } ``` Change it back: ``` In [8]: var1 = xr.DataArray(np.array([1, 2], np.float64), coords=[np.array([1, 2], np.int64)], dims=[""coor1"",], name = ""var1"") In [9]: ds = xr.Dataset({""var1"": var1, ""var2"": var2}) In [10]: ds.to_netcdf(""/tmp/from_xr_3.nc"") ``` and `coor1` is back in the file: ``` $ ncdump /tmp/from_xr_3.nc netcdf from_xr_3 { dimensions: coor1 = 2 ; dim1 = 2 ; variables: int64 coor1(coor1) ; double var1(coor1) ; double var2(dim1) ; data: coor1 = 1, 2 ; var1 = 1, 2 ; var2 = 3, 4 ; } ``` That is, when the coords seem like they are similar to a `range`. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/734/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue