{"action":"created","comment":{"url":"https://api.github.com/repos/numpy/numpy/pulls/comments/29777822","id":29777822,"diff_hunk":"@@ -637,72 +671,67 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)\n         }\n     }\n \n-    /* only pre-calculate slopes if there are relatively few of them. */\n-    j = jprev = 0;\n-    if (lenxp <= lenx) {\n-        slopes = (double *) PyArray_malloc((lenxp - 1)*sizeof(double));\n-        if (! slopes) {\n-            goto fail;\n-        }\n+    /* binary_search_with_guess needs at least a 2 item long array */\n+    if (lenxp == 1) {\n+        const npy_double xp_val = dx[0];\n+        const npy_double fp_val = dy[0];\n+\n         NPY_BEGIN_ALLOW_THREADS;","path":"numpy/core/src/multiarray/compiled_base.c","position":187,"original_position":187,"commit_id":"6ef99eb277aeabf9525c916b27a51bd085925732","original_commit_id":"6ef99eb277aeabf9525c916b27a51bd085925732","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},"body":"Could probably make this key size dependent at some point. ","created_at":"2015-05-06T16:51:17Z","updated_at":"2015-05-06T16:51:17Z","html_url":"https://github.com/numpy/numpy/pull/5843#discussion_r29777822","pull_request_url":"https://api.github.com/repos/numpy/numpy/pulls/5843","_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments/29777822"},"html":{"href":"https://github.com/numpy/numpy/pull/5843#discussion_r29777822"},"pull_request":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5843"}}},"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/5843","id":34793917,"html_url":"https://github.com/numpy/numpy/pull/5843","diff_url":"https://github.com/numpy/numpy/pull/5843.diff","patch_url":"https://github.com/numpy/numpy/pull/5843.patch","issue_url":"https://api.github.com/repos/numpy/numpy/issues/5843","number":5843,"state":"open","locked":false,"title":"BUG: Fix interp issues with small arrays","user":{"login":"jaimefrio","id":3343990,"avatar_url":"https://avatars.githubusercontent.com/u/3343990?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimefrio","html_url":"https://github.com/jaimefrio","followers_url":"https://api.github.com/users/jaimefrio/followers","following_url":"https://api.github.com/users/jaimefrio/following{/other_user}","gists_url":"https://api.github.com/users/jaimefrio/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimefrio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimefrio/subscriptions","organizations_url":"https://api.github.com/users/jaimefrio/orgs","repos_url":"https://api.github.com/users/jaimefrio/repos","events_url":"https://api.github.com/users/jaimefrio/events{/privacy}","received_events_url":"https://api.github.com/users/jaimefrio/received_events","type":"User","site_admin":false},"body":"Fixes #5705","created_at":"2015-05-06T07:31:13Z","updated_at":"2015-05-06T16:51:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c00729f5f1f1915c6760b182745cd94b9e763c11","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/numpy/numpy/pulls/5843/commits","review_comments_url":"https://api.github.com/repos/numpy/numpy/pulls/5843/comments","review_comment_url":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/5843/comments","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/6ef99eb277aeabf9525c916b27a51bd085925732","head":{"label":"jaimefrio:interp_bug","ref":"interp_bug","sha":"6ef99eb277aeabf9525c916b27a51bd085925732","user":{"login":"jaimefrio","id":3343990,"avatar_url":"https://avatars.githubusercontent.com/u/3343990?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimefrio","html_url":"https://github.com/jaimefrio","followers_url":"https://api.github.com/users/jaimefrio/followers","following_url":"https://api.github.com/users/jaimefrio/following{/other_user}","gists_url":"https://api.github.com/users/jaimefrio/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimefrio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimefrio/subscriptions","organizations_url":"https://api.github.com/users/jaimefrio/orgs","repos_url":"https://api.github.com/users/jaimefrio/repos","events_url":"https://api.github.com/users/jaimefrio/events{/privacy}","received_events_url":"https://api.github.com/users/jaimefrio/received_events","type":"User","site_admin":false},"repo":{"id":14343239,"name":"numpy","full_name":"jaimefrio/numpy","owner":{"login":"jaimefrio","id":3343990,"avatar_url":"https://avatars.githubusercontent.com/u/3343990?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimefrio","html_url":"https://github.com/jaimefrio","followers_url":"https://api.github.com/users/jaimefrio/followers","following_url":"https://api.github.com/users/jaimefrio/following{/other_user}","gists_url":"https://api.github.com/users/jaimefrio/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimefrio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimefrio/subscriptions","organizations_url":"https://api.github.com/users/jaimefrio/orgs","repos_url":"https://api.github.com/users/jaimefrio/repos","events_url":"https://api.github.com/users/jaimefrio/events{/privacy}","received_events_url":"https://api.github.com/users/jaimefrio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaimefrio/numpy","description":"Numpy main repository","fork":true,"url":"https://api.github.com/repos/jaimefrio/numpy","forks_url":"https://api.github.com/repos/jaimefrio/numpy/forks","keys_url":"https://api.github.com/repos/jaimefrio/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaimefrio/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaimefrio/numpy/teams","hooks_url":"https://api.github.com/repos/jaimefrio/numpy/hooks","issue_events_url":"https://api.github.com/repos/jaimefrio/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/jaimefrio/numpy/events","assignees_url":"https://api.github.com/repos/jaimefrio/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/jaimefrio/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/jaimefrio/numpy/tags","blobs_url":"https://api.github.com/repos/jaimefrio/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaimefrio/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaimefrio/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaimefrio/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaimefrio/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/jaimefrio/numpy/languages","stargazers_url":"https://api.github.com/repos/jaimefrio/numpy/stargazers","contributors_url":"https://api.github.com/repos/jaimefrio/numpy/contributors","subscribers_url":"https://api.github.com/repos/jaimefrio/numpy/subscribers","subscription_url":"https://api.github.com/repos/jaimefrio/numpy/subscription","commits_url":"https://api.github.com/repos/jaimefrio/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaimefrio/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaimefrio/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaimefrio/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaimefrio/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/jaimefrio/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaimefrio/numpy/merges","archive_url":"https://api.github.com/repos/jaimefrio/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaimefrio/numpy/downloads","issues_url":"https://api.github.com/repos/jaimefrio/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/jaimefrio/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/jaimefrio/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/jaimefrio/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaimefrio/numpy/labels{/name}","releases_url":"https://api.github.com/repos/jaimefrio/numpy/releases{/id}","created_at":"2013-11-12T19:50:00Z","updated_at":"2015-05-06T02:45:34Z","pushed_at":"2015-05-06T16:27:07Z","git_url":"git://github.com/jaimefrio/numpy.git","ssh_url":"git@github.com:jaimefrio/numpy.git","clone_url":"https://github.com/jaimefrio/numpy.git","svn_url":"https://github.com/jaimefrio/numpy","homepage":"http://www.numpy.org/","size":39408,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"numpy:master","ref":"master","sha":"eecb2e3c07f29c0ac991d364a846a2f8293a432a","user":{"login":"numpy","id":288276,"avatar_url":"https://avatars.githubusercontent.com/u/288276?v=3","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"repo":{"id":908607,"name":"numpy","full_name":"numpy/numpy","owner":{"login":"numpy","id":288276,"avatar_url":"https://avatars.githubusercontent.com/u/288276?v=3","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numpy/numpy","description":"Numpy main repository","fork":false,"url":"https://api.github.com/repos/numpy/numpy","forks_url":"https://api.github.com/repos/numpy/numpy/forks","keys_url":"https://api.github.com/repos/numpy/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numpy/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numpy/numpy/teams","hooks_url":"https://api.github.com/repos/numpy/numpy/hooks","issue_events_url":"https://api.github.com/repos/numpy/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/numpy/numpy/events","assignees_url":"https://api.github.com/repos/numpy/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/numpy/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/numpy/numpy/tags","blobs_url":"https://api.github.com/repos/numpy/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numpy/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numpy/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/numpy/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/numpy/numpy/languages","stargazers_url":"https://api.github.com/repos/numpy/numpy/stargazers","contributors_url":"https://api.github.com/repos/numpy/numpy/contributors","subscribers_url":"https://api.github.com/repos/numpy/numpy/subscribers","subscription_url":"https://api.github.com/repos/numpy/numpy/subscription","commits_url":"https://api.github.com/repos/numpy/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/numpy/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/numpy/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/numpy/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/numpy/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/numpy/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numpy/numpy/merges","archive_url":"https://api.github.com/repos/numpy/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numpy/numpy/downloads","issues_url":"https://api.github.com/repos/numpy/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/numpy/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/numpy/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/numpy/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numpy/numpy/labels{/name}","releases_url":"https://api.github.com/repos/numpy/numpy/releases{/id}","created_at":"2010-09-13T23:02:39Z","updated_at":"2015-05-06T16:19:05Z","pushed_at":"2015-05-06T16:19:05Z","git_url":"git://github.com/numpy/numpy.git","ssh_url":"git@github.com:numpy/numpy.git","clone_url":"https://github.com/numpy/numpy.git","svn_url":"https://github.com/numpy/numpy","homepage":"http://www.numpy.org/","size":64965,"stargazers_count":1904,"watchers_count":1904,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":973,"mirror_url":null,"open_issues_count":848,"forks":973,"open_issues":848,"watchers":1904,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5843"},"html":{"href":"https://github.com/numpy/numpy/pull/5843"},"issue":{"href":"https://api.github.com/repos/numpy/numpy/issues/5843"},"comments":{"href":"https://api.github.com/repos/numpy/numpy/issues/5843/comments"},"review_comments":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5843/comments"},"review_comment":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numpy/numpy/pulls/5843/commits"},"statuses":{"href":"https://api.github.com/repos/numpy/numpy/statuses/6ef99eb277aeabf9525c916b27a51bd085925732"}}}}