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/630#issuecomment-458897417,https://api.github.com/repos/pydata/xarray/issues/630,458897417,MDEyOklzc3VlQ29tbWVudDQ1ODg5NzQxNw==,1322974,2019-01-30T10:42:17Z,2019-01-30T10:42:17Z,CONTRIBUTOR,"Looks like the implicit nan-filling behavior is not present anymore, which likely killed the issue?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,112253425 https://github.com/pydata/xarray/issues/630#issuecomment-152269091,https://api.github.com/repos/pydata/xarray/issues/630,152269091,MDEyOklzc3VlQ29tbWVudDE1MjI2OTA5MQ==,1322974,2015-10-29T18:07:54Z,2015-10-29T18:07:54Z,CONTRIBUTOR,"> If you put arrays in a Dataset, you should not count on modifications to the arrays in the Dataset trickling back to the original arrays. I think the most confusing part is that this the modifications will trickle down _sometimes_ -- even though I'd prefer them to be always propagated, I would still mind much less if they were never propagated. At the end of the day it's not my call, feel free to close the issue if you want. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,112253425 https://github.com/pydata/xarray/issues/630#issuecomment-152105174,https://api.github.com/repos/pydata/xarray/issues/630,152105174,MDEyOklzc3VlQ29tbWVudDE1MjEwNTE3NA==,1322974,2015-10-29T07:49:23Z,2015-10-29T07:49:23Z,CONTRIBUTOR,"Sorry to raise the issue again but I just noticed that I had a couple of other places where I wrote quite naturally ``` d = DataArray(...) e = DataArray(...) ds = Dataset({""d"": d, ""e"": e}) ``` which is equivalent to the form I was mentioning earlier (whether `ds` will actually get initialized properly depends on whether `d` and `e` have exactly matching coordinates). To be honest I don't really understand what you mean by ""Unfortunately, it's impossible to make such automatically aligned arrays views in general, because of numpy's memory model."": when the line `ds = Dataset(...)` gets executed, the ndarrays `ds.d.values` and `ds.e.values` either point to the old ndarrays `d.values` and `e.values` or to some newly created, coordinate-aligned ndarrays. If it is the latter, one can just modify `d.values` and `e.values` (as well as their coordinates systems) to point to the new ndarrays, right? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,112253425 https://github.com/pydata/xarray/issues/630#issuecomment-150044109,https://api.github.com/repos/pydata/xarray/issues/630,150044109,MDEyOklzc3VlQ29tbWVudDE1MDA0NDEwOQ==,1322974,2015-10-21T22:37:56Z,2015-10-21T22:37:56Z,CONTRIBUTOR,"Thinking about it again, I think there could just be a mention in the docs that the pattern ``` foo = dataset[key] = DataArray(...) ``` should be avoided and written as ``` dataset[key] = DataArray(...) foo = dataset[key] ``` That should be good enough? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,112253425 https://github.com/pydata/xarray/issues/630#issuecomment-149990310,https://api.github.com/repos/pydata/xarray/issues/630,149990310,MDEyOklzc3VlQ29tbWVudDE0OTk5MDMxMA==,1322974,2015-10-21T18:45:57Z,2015-10-21T18:45:57Z,CONTRIBUTOR,"""If you use the DataArray constructor instead of inserting an item in a Dataset, the array values will always be a view."" Can you explain what you mean here? I am using the DataArray constructor and then inserting the item in the Dataset. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,112253425 https://github.com/pydata/xarray/issues/630#issuecomment-149590758,https://api.github.com/repos/pydata/xarray/issues/630,149590758,MDEyOklzc3VlQ29tbWVudDE0OTU5MDc1OA==,1322974,2015-10-20T14:49:55Z,2015-10-20T14:50:09Z,CONTRIBUTOR,"I was more expecting that if the coordinates are _not_ already aligned, then the DataArray gets modified to point to the ""larger"" array (though of course there may be issues with other variables pointing to the same array, etc.). I like the pattern ``` some_explicit_dict_name[some_explicit_entry_name] = tmpvar = np.array(...) <... work work work on initializing tmpvar, expecting to initialize some_explicit_dict_name[some_explicit_entry_name]> ``` (because the explicit name is a bit too long to work with and I make it immediately clear what `tmpvar` is used for), but xray's behavior makes this work (on DataArrays) only sometimes, with no warning that this could fail to update the array I care about. Not sure what the best approach is. Perhaps ``` tmpvar = dataset.new_dataarray(*args_and_**kwargs_to_DataArray.__init__) ``` which would make sure that no one else is pointing to the internal array at that point? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,112253425