{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/10635","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/10635/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/10635/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/10635/events","html_url":"https://github.com/numpy/numpy/pull/10635","id":298649435,"number":10635,"title":"ENH: Implement initializer kwarg for ufunc.add.reduce","user":{"login":"hameerabbasi","id":2190658,"avatar_url":"https://avatars3.githubusercontent.com/u/2190658?v=4","gravatar_id":"","url":"https://api.github.com/users/hameerabbasi","html_url":"https://github.com/hameerabbasi","followers_url":"https://api.github.com/users/hameerabbasi/followers","following_url":"https://api.github.com/users/hameerabbasi/following{/other_user}","gists_url":"https://api.github.com/users/hameerabbasi/gists{/gist_id}","starred_url":"https://api.github.com/users/hameerabbasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hameerabbasi/subscriptions","organizations_url":"https://api.github.com/users/hameerabbasi/orgs","repos_url":"https://api.github.com/users/hameerabbasi/repos","events_url":"https://api.github.com/users/hameerabbasi/events{/privacy}","received_events_url":"https://api.github.com/users/hameerabbasi/received_events","type":"User","site_admin":false},"labels":[{"id":6359239,"url":"https://api.github.com/repos/numpy/numpy/labels/01%20-%20Enhancement","name":"01 - Enhancement","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}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/numpy/numpy/milestones/52","html_url":"https://github.com/numpy/numpy/milestone/52","labels_url":"https://api.github.com/repos/numpy/numpy/milestones/52/labels","id":2844628,"number":52,"title":"1.15.0 release","description":"","creator":{"login":"charris","id":77272,"avatar_url":"https://avatars3.githubusercontent.com/u/77272?v=4","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":29,"closed_issues":30,"state":"open","created_at":"2017-10-17T21:13:32Z","updated_at":"2018-03-27T16:13:40Z","due_on":null,"closed_at":null},"comments":62,"created_at":"2018-02-20T16:01:37Z","updated_at":"2018-03-27T17:00:54Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/10635","html_url":"https://github.com/numpy/numpy/pull/10635","diff_url":"https://github.com/numpy/numpy/pull/10635.diff","patch_url":"https://github.com/numpy/numpy/pull/10635.patch"},"body":"As discussed in #5032: Adds an `initializer` kwarg for `ufunc.reduce`, plus changes in `min`, `max`, `sum`, `prod`.\r\n\r\nThis acts as the first item in a reduction. It's useful for empty reductions e.g. `np.min([], initializer=np.inf)` reduces to `inf`. It's also useful for starting the reduction with a different value e.g. `np.sum([10], initializer=5)` reduces to `15`. (`5` used as starting value rather than the identity `0`).\r\n\r\nExplicitly passing the initializer as `None` causes empty reductions to err.\r\n\r\n`min`, `max`, `sum` and `prod` only pass on the `initializer` kwarg.\r\n\r\n`PyUFunc_Reduce` is modified to accept the `initializer`. It then replaces the identity by `initializer`.\r\n\r\nChanges are made to `normalize_reduce_args` so that it accepts and parses `initializer` correctly.\r\n\r\nDocumentation has been added for all the changes.\r\n\r\nFixes #5032"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/376599528","html_url":"https://github.com/numpy/numpy/pull/10635#issuecomment-376599528","issue_url":"https://api.github.com/repos/numpy/numpy/issues/10635","id":376599528,"user":{"login":"eric-wieser","id":425260,"avatar_url":"https://avatars3.githubusercontent.com/u/425260?v=4","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},"created_at":"2018-03-27T17:00:54Z","updated_at":"2018-03-27T17:00:54Z","author_association":"MEMBER","body":"> Indeed, I'd rather change identity of the ufuncs to be initializer...\r\n\r\nI don't agree with this - `identity` refers to the special value which is a no-op when passed as an initializer, so needs a different name."}}
{"actor":{"display_login":"eric-wieser"}}