{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/5409","labels_url":"https://api.github.com/repos/numpy/numpy/issues/5409/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5409/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/5409/events","html_url":"https://github.com/numpy/numpy/pull/5409","id":53223414,"number":5409,"title":"ENH: Solves #5407: Implement and test writable view for the diagonal function","user":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/component%3A+numpy.core","name":"component: numpy.core","color":"ff0000"},{"url":"https://api.github.com/repos/numpy/numpy/labels/Task","name":"Task","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/numpy/numpy/milestones/30","labels_url":"https://api.github.com/repos/numpy/numpy/milestones/30/labels","id":518598,"number":30,"title":"1.10 blockers","description":"","creator":{"login":"seberg","id":61977,"avatar_url":"https://avatars.githubusercontent.com/u/61977?v=3","gravatar_id":"","url":"https://api.github.com/users/seberg","html_url":"https://github.com/seberg","followers_url":"https://api.github.com/users/seberg/followers","following_url":"https://api.github.com/users/seberg/following{/other_user}","gists_url":"https://api.github.com/users/seberg/gists{/gist_id}","starred_url":"https://api.github.com/users/seberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seberg/subscriptions","organizations_url":"https://api.github.com/users/seberg/orgs","repos_url":"https://api.github.com/users/seberg/repos","events_url":"https://api.github.com/users/seberg/events{/privacy}","received_events_url":"https://api.github.com/users/seberg/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":5,"state":"open","created_at":"2013-12-20T16:52:18Z","updated_at":"2015-01-13T14:30:32Z","due_on":null,"closed_at":null},"comments":53,"created_at":"2015-01-01T16:45:04Z","updated_at":"2015-01-13T14:40:49Z","closed_at":"2015-01-13T14:30:32Z","pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/5409","html_url":"https://github.com/numpy/numpy/pull/5409","diff_url":"https://github.com/numpy/numpy/pull/5409.diff","patch_url":"https://github.com/numpy/numpy/pull/5409.patch"},"body":"Implements task raised in issue #5407. \r\nThe ``ndarray.diagonal`` method currently returns a view, but it is not writeable. It is documented to return a writeable view in 1.10.\r\nCorrespondingly, the ``writable`` flag is set to ``True`` and the assert statement and the test function are changed accordingly."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/69753278","html_url":"https://github.com/numpy/numpy/pull/5409#issuecomment-69753278","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5409","id":69753278,"user":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T14:40:49Z","updated_at":"2015-01-13T14:40:49Z","body":"Sorry, I was trying to make the branch on par with master, and did ``git rebase master``, but I think it closed the PR. Please mark this as invalid, and do tell me how to prevent it next time. Until then, I will comment on this itself, instead of opening a new PR until you suggest so.\r\n\r\nJust to clarify,\r\n* the situation would be reverted back to 1.7 version, where a copy of the array is returned\r\n* For the ``PyArray_Diagonal2`` function, it should call the ``PyArray_Diagonal`` function accordingly to ``copy`` argument.\r\n* The ``diagonal`` function would now have a `copy`` argument in ``fromnumeric.py``\r\n* If ``copy==1``, then the ``PyArray_Diagonal`` itself would be called\r\n* If ``copy==0``, then depending on the ``WRITABLE`` flag of the input, a view needs to be returned."}}