{"action":"created","issue":{"url":"https://api.github.com/repos/xray/xray/issues/186","labels_url":"https://api.github.com/repos/xray/xray/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/xray/xray/issues/186/comments","events_url":"https://api.github.com/repos/xray/xray/issues/186/events","html_url":"https://github.com/xray/xray/issues/186","id":38110382,"number":186,"title":"Automatic label alignment","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xray/xray/labels/API","name":"API","color":"84b6eb"},{"url":"https://api.github.com/repos/xray/xray/labels/pandas-like","name":"pandas-like","color":"5319e7"},{"url":"https://api.github.com/repos/xray/xray/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/xray/xray/milestones/5","labels_url":"https://api.github.com/repos/xray/xray/milestones/5/labels","id":741199,"number":5,"title":"before 1.0","description":"","creator":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":2,"state":"open","created_at":"2014-08-03T19:39:34Z","updated_at":"2014-12-24T07:07:24Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-07-17T18:18:52Z","updated_at":"2015-02-09T06:48:28Z","closed_at":null,"body":"If we want to mimic pandas, we should support automatic alignment of coordinate labels in:\r\n\r\n- [ ] Mathematical operations (#184)\r\n- [ ] All operations that add new dataset variables (e.g., `merge`, `update`, `__setitem__`).\r\n- [ ] All operations that create a new dataset (e.g., `__init__`, ~~`concat`~~)\r\n\r\nFor the later two cases, it is *not* clear that using an inner join on coordinate labels is the right choice, because that could lead to some surprising destructive operations. This should be considered carefully."},"comment":{"url":"https://api.github.com/repos/xray/xray/issues/comments/73464476","html_url":"https://github.com/xray/xray/issues/186#issuecomment-73464476","issue_url":"https://api.github.com/repos/xray/xray/issues/186","id":73464476,"user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","followers_url":"https://api.github.com/users/shoyer/followers","following_url":"https://api.github.com/users/shoyer/following{/other_user}","gists_url":"https://api.github.com/users/shoyer/gists{/gist_id}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T06:48:28Z","updated_at":"2015-02-09T06:48:28Z","body":"I have most of a working implementation for this that will be up for a PR shortly. Here's some of my thinking on expected behavior.\r\n\r\nBased on the principle that combining arrays into a new dataset should not remove information, it makes sense to use outer joins for `Dataset.__init__` and `Dataset.merge`. This is the same behavior pandas uses\r\n\r\nWhen adding an item to an existing dataset, it would be surprising if indexes or dimension sizes changed. So I think we should be using left joins for `__setitem__` and `update`. This is also what pandas does.\r\n\r\nRight now, we use `Dataset.merge` to handle *all* operations that add new items to a dataset. Adding automatic alignment is turning that into even more of a kludgy mess than it already was. I think some simplification of scope for `update`/`__setitem__`/`merge` would help, though I'm not sure it's worth breaking existing code."}}