{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/8323","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/8323/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/8323/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/8323/events","html_url":"https://github.com/numpy/numpy/issues/8323","id":191884994,"number":8323,"title":"Regression in assert_array_equal when comparing 2d arrays with nested arrays.","user":{"login":"lesteve","id":1680079,"avatar_url":"https://avatars.githubusercontent.com/u/1680079?v=3","gravatar_id":"","url":"https://api.github.com/users/lesteve","html_url":"https://github.com/lesteve","followers_url":"https://api.github.com/users/lesteve/followers","following_url":"https://api.github.com/users/lesteve/following{/other_user}","gists_url":"https://api.github.com/users/lesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/lesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesteve/subscriptions","organizations_url":"https://api.github.com/users/lesteve/orgs","repos_url":"https://api.github.com/users/lesteve/repos","events_url":"https://api.github.com/users/lesteve/events{/privacy}","received_events_url":"https://api.github.com/users/lesteve/received_events","type":"User","site_admin":false},"labels":[{"id":6359214,"url":"https://api.github.com/repos/numpy/numpy/labels/11%20-%20Bug","name":"11 - Bug","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/numpy/numpy/milestones/44","html_url":"https://github.com/numpy/numpy/milestones/1.13.0%20release","labels_url":"https://api.github.com/repos/numpy/numpy/milestones/44/labels","id":1981949,"number":44,"title":"1.13.0 release","description":"","creator":{"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},"open_issues":17,"closed_issues":4,"state":"open","created_at":"2016-09-04T00:50:03Z","updated_at":"2016-11-27T21:16:58Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-11-27T20:54:23Z","updated_at":"2016-11-27T22:00:23Z","closed_at":null,"body":"It started failing one day ago or so in the scikit-learn tests using the development numpy wheels from https://travis-dev-wheels.scipy.org/.\r\n\r\nI can reproduce the error on numpy master with this snippet:\r\n```py\r\nimport numpy as np\r\n\r\nmy_list = [[np.array([1, 2]),\r\n            np.array([1, 2, 3])]]\r\n\r\nnp.testing.assert_array_equal(my_list, my_list)\r\n```\r\n\r\nThe expected behaviour is that there is no exception since I compare `my_list` to itself. The actual behaviour is is an AssertionError with numpy master.\r\n\r\nThe same snippet runs fine with numpy 1.11.2."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/263150790","html_url":"https://github.com/numpy/numpy/issues/8323#issuecomment-263150790","issue_url":"https://api.github.com/repos/numpy/numpy/issues/8323","id":263150790,"user":{"login":"lesteve","id":1680079,"avatar_url":"https://avatars.githubusercontent.com/u/1680079?v=3","gravatar_id":"","url":"https://api.github.com/users/lesteve","html_url":"https://github.com/lesteve","followers_url":"https://api.github.com/users/lesteve/followers","following_url":"https://api.github.com/users/lesteve/following{/other_user}","gists_url":"https://api.github.com/users/lesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/lesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesteve/subscriptions","organizations_url":"https://api.github.com/users/lesteve/orgs","repos_url":"https://api.github.com/users/lesteve/repos","events_url":"https://api.github.com/users/lesteve/events{/privacy}","received_events_url":"https://api.github.com/users/lesteve/received_events","type":"User","site_admin":false},"created_at":"2016-11-27T22:00:22Z","updated_at":"2016-11-27T22:00:22Z","body":"> This is no doubt due to the new lack of identity fallback when the array comparisons don't yield scalar boolean values. The test would probably fail previously if the second array was a copy of the first rather than the same array. I think the failure here is probably the right thing to do.\r\n\r\nOK thanks, I wasn't aware of these subtleties and as you hinted the following snippet fails already on 1.11.2:\r\n\r\n```py\r\nimport numpy as np\r\n\r\nmy_list = [[np.array([1, 2]),\r\n            np.array([1, 2, 3])]]\r\n\r\nmy_list_2 = [[np.array([1, 2]),\r\n            np.array([1, 2, 3])]]\r\n\r\nnp.testing.assert_array_equal(my_list, my_list_2)\r\n```\r\n\r\nIt looks like we were just (un)lucky to be in a edge case where the test would still pass so we'll just change our tests.\r\n\r\n> The identity fallback has been deprecated since NumPy 1.9. Perhaps that wasn't passed through the test?\r\n\r\nFor the record, I don't get any DeprecationWarning running the first snippet I posted with numpy 1.11.2."}}
{"actor":{"display_login":"lesteve"}}