{"action":"created","issue":{"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1685","repository_url":"https://api.github.com/repos/MDAnalysis/mdanalysis","labels_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1685/labels{/name}","comments_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1685/comments","events_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1685/events","html_url":"https://github.com/MDAnalysis/mdanalysis/issues/1685","id":268170754,"number":1685,"title":"Using load_new with MemoryReader","user":{"login":"Yuan-Yu","id":8809778,"avatar_url":"https://avatars2.githubusercontent.com/u/8809778?v=4","gravatar_id":"","url":"https://api.github.com/users/Yuan-Yu","html_url":"https://github.com/Yuan-Yu","followers_url":"https://api.github.com/users/Yuan-Yu/followers","following_url":"https://api.github.com/users/Yuan-Yu/following{/other_user}","gists_url":"https://api.github.com/users/Yuan-Yu/gists{/gist_id}","starred_url":"https://api.github.com/users/Yuan-Yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yuan-Yu/subscriptions","organizations_url":"https://api.github.com/users/Yuan-Yu/orgs","repos_url":"https://api.github.com/users/Yuan-Yu/repos","events_url":"https://api.github.com/users/Yuan-Yu/events{/privacy}","received_events_url":"https://api.github.com/users/Yuan-Yu/received_events","type":"User","site_admin":false},"labels":[{"id":244973372,"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/labels/Component-Core","name":"Component-Core","color":"ff0000","default":false},{"id":476607458,"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/labels/Format-MemoryReader","name":"Format-MemoryReader","color":"006b75","default":false},{"id":452140802,"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/labels/GSOC%20Starter","name":"GSOC Starter","color":"ff9933","default":false},{"id":195620654,"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/labels/defect","name":"defect","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"palnabarun","id":10010419,"avatar_url":"https://avatars3.githubusercontent.com/u/10010419?v=4","gravatar_id":"","url":"https://api.github.com/users/palnabarun","html_url":"https://github.com/palnabarun","followers_url":"https://api.github.com/users/palnabarun/followers","following_url":"https://api.github.com/users/palnabarun/following{/other_user}","gists_url":"https://api.github.com/users/palnabarun/gists{/gist_id}","starred_url":"https://api.github.com/users/palnabarun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palnabarun/subscriptions","organizations_url":"https://api.github.com/users/palnabarun/orgs","repos_url":"https://api.github.com/users/palnabarun/repos","events_url":"https://api.github.com/users/palnabarun/events{/privacy}","received_events_url":"https://api.github.com/users/palnabarun/received_events","type":"User","site_admin":false},"assignees":[{"login":"palnabarun","id":10010419,"avatar_url":"https://avatars3.githubusercontent.com/u/10010419?v=4","gravatar_id":"","url":"https://api.github.com/users/palnabarun","html_url":"https://github.com/palnabarun","followers_url":"https://api.github.com/users/palnabarun/followers","following_url":"https://api.github.com/users/palnabarun/following{/other_user}","gists_url":"https://api.github.com/users/palnabarun/gists{/gist_id}","starred_url":"https://api.github.com/users/palnabarun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palnabarun/subscriptions","organizations_url":"https://api.github.com/users/palnabarun/orgs","repos_url":"https://api.github.com/users/palnabarun/repos","events_url":"https://api.github.com/users/palnabarun/events{/privacy}","received_events_url":"https://api.github.com/users/palnabarun/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2017-10-24T20:15:32Z","updated_at":"2018-03-21T17:32:29Z","closed_at":null,"author_association":"NONE","body":"### Expected behaviour\r\n\r\n\r\n### Actual behaviour\r\nreturn an error :(\r\n\r\n### Code to reproduce the behaviour\r\n\r\n\r\n\r\n\r\n``` python\r\nimport MDAnalysis as mda\r\n\r\nu = mda.Universe(top, trj)\r\nprot = u.select_atoms('protein')\r\nu2 = mda.Merge(prot)\r\nu2.load_new( [ prot.positions ], format=MemoryReader )\r\n....\r\n\r\n```\r\n\r\n### Currently version of MDAnalysis: \r\n0.16.2\r\n\r\nThe reason is that \"load_new\" remove one dimension of the input array when the first dimension of the array is one. \r\nhttps://github.com/MDAnalysis/mdanalysis/blob/2e22d06e356449723ad04623311d25f2591b8106/package/MDAnalysis/core/universe.py#L441-L443\r\n\r\nThanks for help!\r\n"},"comment":{"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/comments/375030012","html_url":"https://github.com/MDAnalysis/mdanalysis/issues/1685#issuecomment-375030012","issue_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1685","id":375030012,"user":{"login":"orbeckst","id":237980,"avatar_url":"https://avatars0.githubusercontent.com/u/237980?v=4","gravatar_id":"","url":"https://api.github.com/users/orbeckst","html_url":"https://github.com/orbeckst","followers_url":"https://api.github.com/users/orbeckst/followers","following_url":"https://api.github.com/users/orbeckst/following{/other_user}","gists_url":"https://api.github.com/users/orbeckst/gists{/gist_id}","starred_url":"https://api.github.com/users/orbeckst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orbeckst/subscriptions","organizations_url":"https://api.github.com/users/orbeckst/orgs","repos_url":"https://api.github.com/users/orbeckst/repos","events_url":"https://api.github.com/users/orbeckst/events{/privacy}","received_events_url":"https://api.github.com/users/orbeckst/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T17:32:29Z","updated_at":"2018-03-21T17:32:29Z","author_association":"OWNER","body":"I think the check should be more specific: it's only the `(N, 3)` case that we want to promote,\r\n```python\r\nif len(arr.shape) == 2 and arr.shape[1] == 3:\r\n  arr = arr[np.newaxis, :, :]\r\n```\r\n(with appropriate error checking).\r\n\r\nI'd say try it out in the MemoryReader and then we see if this works. So far, this sounds like the best idea to me but obviously things can change when we see how it works in practice."}}
{"actor":{"display_login":"orbeckst"}}