{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/8584","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/8584/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/8584/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/8584/events","html_url":"https://github.com/numpy/numpy/pull/8584","id":206281434,"number":8584,"title":"MAINT: Use the same exception for all bad axis requests","user":{"login":"eric-wieser","id":425260,"avatar_url":"https://avatars.githubusercontent.com/u/425260?v=3","gravatar_id":"","url":"https://api.github.com/users/eric-wieser","html_url":"https://github.com/eric-wieser","followers_url":"https://api.github.com/users/eric-wieser/followers","following_url":"https://api.github.com/users/eric-wieser/following{/other_user}","gists_url":"https://api.github.com/users/eric-wieser/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-wieser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-wieser/subscriptions","organizations_url":"https://api.github.com/users/eric-wieser/orgs","repos_url":"https://api.github.com/users/eric-wieser/repos","events_url":"https://api.github.com/users/eric-wieser/events{/privacy}","received_events_url":"https://api.github.com/users/eric-wieser/received_events","type":"User","site_admin":false},"labels":[{"id":36825825,"url":"https://api.github.com/repos/numpy/numpy/labels/10%20-%20Maintenance","name":"10 - Maintenance","color":"fef2c0","default":false},{"id":16917029,"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.core","name":"component: numpy.core","color":"009800","default":false},{"id":16917082,"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.lib","name":"component: numpy.lib","color":"009800","default":false},{"id":16915566,"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.linalg","name":"component: numpy.linalg","color":"009800","default":false},{"id":16917467,"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.ma","name":"component: numpy.ma","color":"009800","default":false},{"id":16917596,"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.polynomial","name":"component: numpy.polynomial","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2017-02-08T18:19:36Z","updated_at":"2017-02-20T20:24:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/8584","html_url":"https://github.com/numpy/numpy/pull/8584","diff_url":"https://github.com/numpy/numpy/pull/8584.diff","patch_url":"https://github.com/numpy/numpy/pull/8584.patch"},"body":"Lots of functions accept an axis argument that can be negative, implying wraparound. The same few lines of code are repeated all over the place to implement this.\r\n\r\nWhen the axis is just plain invalid, an error is raised. However:\r\n* Some things raise `IndexError`, others raise `ValueError`. This PR somehwat arbitrarily assumes that `IndexError` is the right type of exception to raise.\r\n* Some messages are more useful than others\r\n* Some functions don't check for `axis < -ndim`\r\n\r\nIt seems it would be better to put all this in one place.\r\n\r\nThis was previously filed as an issue at  #8583.   Function name and location inspired by `check_and_adjust_index`. `check_and_adjust_index(...) < 0` is used to match `check_and_adjust_axis(...) < 0`.\r\n\r\nThis was previously discussed [on the mailing list](https://mail.scipy.org/pipermail/numpy-discussion/2016-September/075951.html) by @charris and @seberg"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/281173869","html_url":"https://github.com/numpy/numpy/pull/8584#issuecomment-281173869","issue_url":"https://api.github.com/repos/numpy/numpy/issues/8584","id":281173869,"user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"created_at":"2017-02-20T20:24:38Z","updated_at":"2017-02-20T20:24:38Z","body":"`normalize_axis_index` would also be fine with me. @shoyer?"}}
{"actor":{"display_login":"mhvk"}}