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 125708367,MDU6SXNzdWUxMjU3MDgzNjc=,712,DataArrays should display their coordinates in the natural order,1322974,open,0,,,13,2016-01-08T22:33:05Z,2020-11-06T18:48:54Z,,CONTRIBUTOR,,,,"Consider ``` from collections import * import numpy as np from xray import * d1 = DataArray(np.empty((2, 2)), coords=OrderedDict([(""foo"", [0, 1]), (""bar"", [0, 1])])) d2 = DataArray(np.empty((2, 2)), coords=OrderedDict([(""bar"", [0, 1]), (""foo"", [0, 1])])) ds = Dataset({""d1"": d1, ""d2"": d2}) print(ds.d1) print(ds.d2) ``` This outputs ``` array([[ 6.91516848e-310, 1.64244654e-316], [ 6.91516881e-310, 6.91516881e-310]]) Coordinates: * foo (foo) int64 0 1 * bar (bar) int64 0 1 array([[ 1.59987863e-316, 6.91516883e-310], [ 6.91515690e-310, 2.12670320e-316]]) Coordinates: * foo (foo) int64 0 1 * bar (bar) int64 0 1 ``` I understand that internally both DataArrays use the same coords object and thus the same coords order, but it would be helpful if, when printing d2 by itself, the coordinates were printed in the natural order (""bar"", ""foo""). In particular, when working interactively, the list of coordinates at the end of the repr is the most easy thing to spot, and thus most helpful to know how to format the call to `array.loc[...]`. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/712/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 112254767,MDU6SXNzdWUxMTIyNTQ3Njc=,631,Confusing error (or lack thereof) when coordinate and variable share the same name,1322974,open,0,,,5,2015-10-19T23:39:22Z,2019-04-19T15:39:55Z,,CONTRIBUTOR,,,,"It probably makes sense to prevent dataset to have variables sharing the names of coordinates (what would `dataset.varname` return?) but currently ``` Dataset({""a"": DataArray(np.zeros((3, 4)), dims=[""a"", ""b""], coords={""a"": list(""xyz""), ""b"": list(""xyzt"")})}) ``` fails with `ValueError: an index variable must be defined with 1-dimensional data`, and ``` Dataset({""a"": DataArray(np.zeros(3), coords={""a"": list(""xyz"")})}) ``` actually creates an empty dataset using `[0, 0, 0]` as values for the `a` coordinate instead of `x y z`: ``` Dimensions: (a: 3) Coordinates: * a (a) float64 0.0 0.0 0.0 Data variables: *empty* ``` ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/631/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue 112253425,MDU6SXNzdWUxMTIyNTM0MjU=,630,Whether a DataArray is copied when inserted into a Dataset depends on whether coordinates match exactly,1322974,open,0,,,16,2015-10-19T23:27:15Z,2019-01-31T18:40:58Z,,CONTRIBUTOR,,,,"Consider ``` import numpy as np from xray import * ds = Dataset({""a"": DataArray(np.zeros((3, 4)))}) ds[""b""] = b = DataArray(np.zeros((3, 4))) b[0, 0] = 1 print(ds[""b""][0, 0]) # ==> prints 1 ds = Dataset({""a"": DataArray(np.zeros((3, 4)))}) ds[""b""] = b = DataArray(np.zeros((3, 3))) # !!! we implicitly fill the last column with nans. b[0, 0] = 1 print(ds[""b""][0, 0]) # ==> prints 0 ``` In the first case, the dataset was modified when the dataarray was modified, but not in the second case. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/630/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,issue