{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/5472","labels_url":"https://api.github.com/repos/numpy/numpy/issues/5472/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5472/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/5472/events","html_url":"https://github.com/numpy/numpy/pull/5472","id":54929831,"number":5472,"title":"BUG: ma: in-place operations fail dtype checks","user":{"login":"perimosocordiae","id":82855,"avatar_url":"https://avatars.githubusercontent.com/u/82855?v=3","gravatar_id":"","url":"https://api.github.com/users/perimosocordiae","html_url":"https://github.com/perimosocordiae","followers_url":"https://api.github.com/users/perimosocordiae/followers","following_url":"https://api.github.com/users/perimosocordiae/following{/other_user}","gists_url":"https://api.github.com/users/perimosocordiae/gists{/gist_id}","starred_url":"https://api.github.com/users/perimosocordiae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perimosocordiae/subscriptions","organizations_url":"https://api.github.com/users/perimosocordiae/orgs","repos_url":"https://api.github.com/users/perimosocordiae/repos","events_url":"https://api.github.com/users/perimosocordiae/events{/privacy}","received_events_url":"https://api.github.com/users/perimosocordiae/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.ma","name":"component: numpy.ma","color":"ff0000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-20T19:47:08Z","updated_at":"2015-02-15T00:58:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/5472","html_url":"https://github.com/numpy/numpy/pull/5472","diff_url":"https://github.com/numpy/numpy/pull/5472.diff","patch_url":"https://github.com/numpy/numpy/pull/5472.patch"},"body":"An error is thrown if you run this code on current numpy master:\r\n\r\n```\r\nimport numpy as np\r\nfoo = np.ma.array([5], mask=[True], dtype=np.uint16)\r\nfoo += np.uint16(1)\r\n```\r\n\r\nThe use of np.where with a constant scalar causes a TypeError when the dtype of the masked array is incompatible with `np.int64` (the default dtype for constant integers, on my machine).\r\n\r\nThe test case only checks iadd, but the bug touches seven operations in total: iadd, isub, imul, idiv, ifloordiv, itruediv, and ipow. If desired, I can add tests for the rest of the operations as well."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/74399176","html_url":"https://github.com/numpy/numpy/pull/5472#issuecomment-74399176","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5472","id":74399176,"user":{"login":"charris","id":77272,"avatar_url":"https://avatars.githubusercontent.com/u/77272?v=3","gravatar_id":"","url":"https://api.github.com/users/charris","html_url":"https://github.com/charris","followers_url":"https://api.github.com/users/charris/followers","following_url":"https://api.github.com/users/charris/following{/other_user}","gists_url":"https://api.github.com/users/charris/gists{/gist_id}","starred_url":"https://api.github.com/users/charris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charris/subscriptions","organizations_url":"https://api.github.com/users/charris/orgs","repos_url":"https://api.github.com/users/charris/repos","events_url":"https://api.github.com/users/charris/events{/privacy}","received_events_url":"https://api.github.com/users/charris/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T00:58:02Z","updated_at":"2015-02-15T00:58:02Z","body":"See also #5563. The two PR's address the same problem."}}